mrmbarnes — 2012-01-22T00:59:07-05:00 — #1
I am using the php mail function and have this header:
$headers = "From: My Business Name \r\
$headers .= "Reply-To: website@$domainname\r\
$headers .= "Content-type: text/html; charset=iso-8859-1\r\
It all seems to work fine in Outlook and it says the they email is from me however with the same email in Gmail (Unkown Sender)
Any ideas on how to get around this?
jakub_polak — 2012-01-22T04:55:02-05:00 — #2
this code should do the job, just change the value of $to variable to your actual gmail address so you can test it.
$domainname = 'example.com';
$to = 'email@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: "My Business Name" <firstname.lastname@example.org>' . "\\r\
'Reply-To: website@$domainname' . "\\r\
'X-Mailer: PHP/' . phpversion(). "\\r\
'Content-type: text/html; charset=iso-8859-1' . "\\r\
mail($to, $subject, $message, $headers);
mrmbarnes — 2012-01-22T06:54:24-05:00 — #3
Thanks for that but I'm not actually using a gmail.com account. We are using Google Apps so we log into gmail with our company domain... I have 3 totally separate Google Apps accounts. All with different domain logins & none with gmail.com.
Any other ideas?
jakub_polak — 2012-01-22T07:02:27-05:00 — #4
I beleive that it should work with the Google Apps account as well. Have you tried to code?
jdog — 2012-01-22T12:57:29-05:00 — #5
Have you tried to add the email as an approved sender in Google apps?