Javamail API - How do you change setFrom to whatever you want?

后端 未结 4 1706
孤独总比滥情好
孤独总比滥情好 2021-01-12 06:38

How do I change the setFrom() method to whatever I want? I can send e-mails through my gmail accoutn and change the setFrom text, but it shows my username for t

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-12 07:15

    Faced Same problem while using "smtp.gmail.com". Use Mandrill,it will work. Once you setup a Mandrill account,use "smtp.mandrillapp.com" on port 587. For Authentication,set username=your mandrill username and password=API key generated in your account.

提交回复
热议问题