Am writing a PHP script to email a confirmation link in order to double-opt-in emails.
When I send the email, instead of showing the email as coming from:
"Joe Smith" <email@example.com>
...it shows the email as coming from:
For this application, HostMonster is the hosting company. So I read their support page:
...which says you are required to put a properly formatted , valid From: field in the email's header, or else it will change the From: address to username@host###.HostMonst
er.com. (Which is what is happening, it seems.)
This page gives the following examples of properly formatted From fields:
From: "user" <firstname.lastname@example.org>
Problem is, I don't see how I am not conforming to this standard. Here is my php code for defining the header (email addresses and names have been changed for anonymity, but the format is exactly as follows):
$header = 'Reply-To: "Joe Smith" <email@example.com>\n';
$header .= 'Return-Path: "Joe Smith" <firstname.lastname@example.org>\n';
$header .= 'From: "Joe Smith" <email@example.com>\n';
$header .= "Organization: Joe Smith Corp\n";
$header .= "Content-Type: text/plain\n";
HostMonster tech support referred me to the document I already had found and applied above. They said they do not troubleshoot code, and suggested online help forums.
How can I fix this?