I want to send an email from A to B,with HEADER and CONTENT through gmail.
How to do that by PHP?<
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:
- On your computer, open Gmail.
- In the top right, click Settings.
- Click the Accounts and import or Accounts tab.
- In the "Send mail as" section, click Add another email address.
- Enter your name and the address you want to send from.
- Click Next Step and then Send verification.
- 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.
- 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.