Jump to content

email on behalf of, issue with contact us script.


Bottyz

Recommended Posts

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!

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.

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.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.