This paper addresses the role of affect and emotions in shaping the behavior of responders in the ultimatum game. A huge amount of research shows that players do not behave in an economically rational way in the ultimatum game, and emotional mechanisms have been proposed as a possible explanation. In particular, feelings of fairness, anger and envy are likely candidates as affective determinants. We introduce a three-player ultimatum game with three-options, which permits the responder to either penalize the proposer or to penalize a third party by rejecting offers. This allows for partially distinguishing rejections due to a retaliation motive driven by anger towards the proposer from rejections due to inequity aversion driven by feelings of envy towards a third party. Results from two experiments suggest that responders experience feelings of dissatisfaction and unfairness if their share is small in comparison to the proposer's share; anger, then, may trigger rejections towards the proposer. Responders also experience dissatisfaction and envy when third party shares exceed their own shares; however, in contrast to anger, envy does not trigger rejections and is dissociated from the decision to accept or reject an offer. We conclude that acting upon anger is socially acceptable, whereas envy is not acceptable as a reason for action. Furthermore, we find that responders generally feel better after rejections, suggesting that rejections serve to regulate one's affective state.