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 <"enquiries@joebloggs.com">. With all the usual subject/message.

 

Now it comes through as ourusername@server1.host.com On Behalf Of enquiries@joebloggs.com

 

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="enquiries@joebloggs.com";
	$contact_subject="Alert: ";
	$contact_from_email="enquiries@joebloggs.com";

	$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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.