How to change from-address when using gmail smtp server

后端 未结 6 629
一向
一向 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:06

    The answer above are not quite correct.

    You are definitely able to specify any senders as long as you own the other email address.

    As the help page explains:

    1. On your computer, open Gmail.
    2. In the top right, click Settings.
    3. Click the Accounts and import or Accounts tab.
    4. In the "Send mail as" section, click Add another email address.
    5. Enter your name and the address you want to send from.
    6. Click Next Step and then Send verification.
    7. For school or work accounts, enter the SMTP server (for example, smtp.gmail.com or smtp.yourschool.edu) and the username and password on that account.
    8. Click Add Account.

    Once that email is added successfully, you can send email on the behalf of the new email address in gmail.

    Google will not rewrite your from email in this way while you're sending email via Google SMTP.

提交回复
热议问题