- Issue created by @jglynn
- 🇨🇦Canada jglynn
To answer my own question, I was able to change the 'from' address by going into the settings for my Gmail account and changing the 'send email as' setting to no-reply@xxx.com.
I would have thought this would be possible through the module settings.
- 🇦🇺Australia imclean Tasmania
The "From" header email address is whatever the sending module sets it to. For example, the Webform module allows you to specify the "From" address in a mail handler. PHPMailer SMTP won't change the header, it passes it through as requested.
You can do this in code using hook_mail_alter(), setting
$message['headers']['From'] = 'no-reply@xxx.com';
.That said, Google might not allow you to send from a different email address than the one associated with the account, which means the From address will always be jeff@... You can check this by using a different SMTP server.
The envelope sender (the SMTP command "MAIL FROM") address is where bounce messages are sent. The recipient's mail server adds the "Return-path" header based on this address.
- Status changed to Fixed
almost 2 years ago 3:31am 25 January 2023 - Status changed to Closed: works as designed
almost 2 years ago 9:45pm 31 January 2023