Social media-transmitted online information, particularly content that is emotionally charged, shapes our thoughts and actions. In this study, we incorporate social network theories and analyses to investigate how emotions shape online content diffusion, using a computational approach. We rigorously quantify and characterize the structural properties of diffusion cascades, in which more than six million unique individuals transmitted 387,486 articles in a massive-scale online social network, WeChat. We detected the degree of eight discrete emotions (i.e., surprise, joy, anticipation, love, anxiety, sadness, anger, and disgust) embedded in these articles, using a newly generated domain-specific and up-to-date emotion lexicon. We found that articles with a higher degree of anxiety and love reached a larger number of individuals and diffused more deeply, broadly, and virally, whereas sadness had the opposite effect. Age and network degree of the individuals who transmitted an article and, in particular, the social ties between senders and receivers, significantly mediated how emotions affect article diffusion. These findings offer valuable insight into how emotions facilitate or hinder information spread through social networks and how people receive and transmit online content that induces various emotions.