Social dilemmas have attracted extensive interest in multiagent system research in order to study the emergence of cooperative behaviors among selfish agents. Without extra mechanisms or assumptions, directly applying multiagent reinforcement learning in social dilemmas will end up with convergence to the Nash equilibrium of mutual defection among the agents. This paper investigates the importance of emotions in modifying agent learning behaviors in order to achieve cooperation in social dilemmas. Two fundamental variables, individual wellbeing and social fairness, are considered in the appraisal of emotions that are used as intrinsic rewards for learning. Experimental results reveal that different structural relationships between the two appraisal variables can lead to distinct agent behaviors, and under certain circumstances, cooperation can be obtained among the agents.