Bottyz Posted September 23, 2011 Share Posted September 23, 2011 Hi all, Our webhost has upgraded to a more secure mail server and since then all the enquiries we receive from our own website don't have our name to them. For example: Before the mail server was changed our emails from our contactus.php would come in as Joe Bloggs Ltd <"[email protected]">. With all the usual subject/message. Now it comes through as [email protected] On Behalf Of [email protected] This wouldn't be a problem, except this happens on any of the successfully registered etc emails which come from our regirstration area on the website (as it uses a very similar script method). So our customers sometimes block the email as its coming from a random address. The script works as so: $contact_to_email="[email protected]"; $contact_subject="Alert: "; $contact_from_email="[email protected]"; $visitor_name_and_email="$visitor_name (" . $visitor_email . ")"; $contact_from_email="$contact_from_name <$contact_from_email>"; $message_subject="Website Enquiry"; //message $headers = "From: " . $contact_from_email . "\r\n"; $headers .= "Reply-To: ". $contact_from_email . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; mail($contact_to_email, $contact_subject." $message_subject", $message, $headers); I've stripped out input verification etc to make it easier to read. Is there anything I can do to the script above to cure the issue? Ta! Quote Link to comment https://forums.phpfreaks.com/topic/247717-email-on-behalf-of-issue-with-contact-us-script/ Share on other sites More sharing options...
requinix Posted September 23, 2011 Share Posted September 23, 2011 You need to send from whatever email server handles joebloggs.com (smtp.europe.secureserver.net). Otherwise, since server1.host.com knows that it doesn't handle that domain's email traffic, then it will include a Sender: header which triggers the "on behalf of" reaction. Quote Link to comment https://forums.phpfreaks.com/topic/247717-email-on-behalf-of-issue-with-contact-us-script/#findComment-1272086 Share on other sites More sharing options...
Bottyz Posted September 26, 2011 Author Share Posted September 26, 2011 You need to send from whatever email server handles joebloggs.com (smtp.europe.secureserver.net). Otherwise, since server1.host.com knows that it doesn't handle that domain's email traffic, then it will include a Sender: header which triggers the "on behalf of" reaction. Thanks for the reply, would mail.joebloggs.com (as set in my dns a records) be what I'm looking to use? Or do I need to put something else? It is all sent via the php mail() function so doesn't use smtp. Quote Link to comment https://forums.phpfreaks.com/topic/247717-email-on-behalf-of-issue-with-contact-us-script/#findComment-1272837 Share on other sites More sharing options...
requinix Posted September 26, 2011 Share Posted September 26, 2011 Question: what is the actual server1.host.com you mentioned before? Is it a long name starting with "p3pwssweb"? Otherwise you can PM me if you don't want it public. Quote Link to comment https://forums.phpfreaks.com/topic/247717-email-on-behalf-of-issue-with-contact-us-script/#findComment-1272954 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.