How to change from-address when using gmail smtp server

后端 未结 6 669
一向
一向 2020-11-22 12:24

I want to send an email from A to B,with HEADER and CONTENT through gmail.

How to do that by PHP?<

6条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 13:01

    You need to go to GMAIL settings and add new alias.

    You will be asked SMTP information, which is basically useless, since you are using SMTP to send email, BUT the catch is that if your alias is on Google Suite domain it will be added just with simple email confirmation!

    Once you have the alias there, you can change "From" header in your SMTP email.


    NOTE: You cannot change the "From" address to whatever@dude.com, that's just how Gmail works and is the reason it's trusted.

提交回复
热议问题