mail addition_headers help
Posted: Tue Nov 18, 2008 7:31 pm
Okay, I am hoping someone can easily answer this. I've been looking for 5 hours on how to solve this and have read parts of RFC2822 and am still not having any luck. I am trying to compose an automated email sent out from our server when a new user registers on our website. I have never had a problem constructing an email until today. This is the construction of my email:
$subject = "Registration Successful";
$headers = "MIME-Version: 1.0 \r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \r\n";
$headers .= "From: My Company, Inc. <webmaster@somedomain.tld> \r\n";
The problem I'm having is that the comma above (,) is causing the email to default to the email address of: Web Solutions@FDQN. (where FQDN is the fully qualified domain name of my server) If I remove the comma, the email format is fine and shows as My Company Inc. <webmaster@somedomain.tld>, but when I include the comma it causes problems and only shows My Company@FQDN. The client I'm designing the site for is okay with the comma not being there, but now this has become a battle between me and this stupid comma. I have tried about 30 different ways for escaping this string, using ASCII codes instead of the actual comma, using the us-ascii charset instead of iso-8859-1 amongst many other things and this is really starting to drive me crazy. (by the way, Postfix is my MTA) Can anyone please help?
$subject = "Registration Successful";
$headers = "MIME-Version: 1.0 \r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \r\n";
$headers .= "From: My Company, Inc. <webmaster@somedomain.tld> \r\n";
The problem I'm having is that the comma above (,) is causing the email to default to the email address of: Web Solutions@FDQN. (where FQDN is the fully qualified domain name of my server) If I remove the comma, the email format is fine and shows as My Company Inc. <webmaster@somedomain.tld>, but when I include the comma it causes problems and only shows My Company@FQDN. The client I'm designing the site for is okay with the comma not being there, but now this has become a battle between me and this stupid comma. I have tried about 30 different ways for escaping this string, using ASCII codes instead of the actual comma, using the us-ascii charset instead of iso-8859-1 amongst many other things and this is really starting to drive me crazy. (by the way, Postfix is my MTA) Can anyone please help?