PHP Form with Thank You Auto Reply


#1

Hello,

I have a registration form that sends an email to a church and a thank you reply to the sender. Both contain most of the same information. I’m aware of the problem with DreamHost requiring an email “From” address that’s an email address hosted on DreamHost. The email used "do-not-reply@mainjane.com" is hosted on DreamHost. While the email to the church arrives promptly, the thank you email to the sender often has days of delay before arriving. Can anyone see anything in the form code below that might cause that? I didn’t get any help from DreamHost support and it’s been 4 days now.

Below the form code, I’m adding a sample long header, which shows the days of delay between sending and arriving. The Reply-To does not appear, and the Return-Path appears duplicated…? The third Received listed occurred on 6 Feb, but the email didn’t arrive until 10 Feb 2013.

I’d appreciate any help I can get.

Thank you in advance!

FORM CODE FOR INFORMATION REQUEST:

$to = "jane@mainjane.com";
$subject = "Info Request";
$message .= "Hello Jane, \n\n";
$message .= $user_f_name . " " . $user_l_name . " sent you the following request regarding Main Jane Designs LLC.\n\n";
$message .= "Thank you, \n\n";
$message .= "The Auto Responder \n\n\n";
$message .= "************************************************ \n\n";
$message .= "Message Details:\n";
$message .= "Name: " . $user_f_name . " " . $user_l_name . "\r\n";
$message .= "Email: " . $user_email . "\r\n";
$message .= "Image ID: " . $id . " " . $icap . "\r\n";
$message .= "Gallery ID: " . $port_id . " " . $port_desc . "\r\n";
$message .= "Comments: " .  $user_com . "\r\n";
$headers = "From: do-not-reply@mainjane.com" . "\r\n";
$headers = "Reply-To:" . $user_email . "\r\n";
$mailsend = mail($to, $subject, $message, $headers);
$to = "";
$subject = "";
$message = "";
$headers = "";
$mailsend = "";
$to = $user_email;
$subject = "Thank You";
$message .= "Hello " . $user_f_name . ",\n\n";
$message .= "Thank you for contacting Main Jane Designs LLC. We will respond to your request as soon as possible. \n\n";
$message .= "Sincerely, \n\n";
$message .= "Jane Benson \n\n\n";
$message .= "************************************************ \n\n";
$message .= "Message Details:\n";
$message .= "Name: " . $user_f_name . " " . $user_l_name . "\n";
$message .= "Email: " . $user_email . "\r\n";
$message .= "Image ID: " . $id . " " . $icap . "\r\n";
$message .= "Gallery ID: " . $port_id . " " . $port_desc . "\r\n";
$message .= "Comments: " . $user_com . "\r\n";
$headers = "From: do-not-reply@mainjane.com" . "\r\n";
$headers = "Reply-To: jane@mainjane.com" . "\r\n";
$mailsend = mail($to, $subject, $message, $headers);

SAMPLE LONG HEADER FOR DELAYED ARRIVAL OF THANK YOU AUTO REPLY

From: 	do-not-reply@mainjane.com
Subject: 	Thank You
Date: 	February 6, 2013 5:47:57 PM CST
To: 	Jane Benson <janebenson@new.rr.com>
Return-Path: 	<mainjane@tift.dreamhost.com>
Return-Path: 	<mainjane@tift.dreamhost.com>
Received: 	from hrndva-mxlb.mail.rr.com ([10.128.255.126]) by hrndva-imta08.mail.rr.com with ESMTP id <20130210000328862.SNYN4646@hrndva-imta08.mail.rr.com> for <janebenson@new.rr.com>; Sun, 10 Feb 2013 00:03:28 +0000
Received: 	from [208.113.157.41] ([208.113.157.41:39422] helo=iad1-vsguest-relay2.dreamhost.com) by hrndva-iedge01.mail.rr.com (envelope-from <mainjane@tift.dreamhost.com>) (ecelerity 2.2.3.46 r()) with ESMTP id 81/C0-01875-0D3E6115; Sun, 10 Feb 2013 00:03:28 +0000
Received: 	from iad1-vsguest-relay1.dreamhost.com (iad1-vsguest-relay1.dreamhost.com [208.113.157.44]) by iad1-vsguest-relay2.dreamhost.com (Postfix) with ESMTP id 39FC6800B0F11 for <janebenson@new.rr.com>; Wed,  6 Feb 2013 15:47:58 -0800 (PST)
Received: 	from tift.dreamhost.com (unknown [64.111.126.32]) by iad1-vsguest-relay1.dreamhost.com (Postfix) with ESMTP id 3196872D5B for <janebenson@new.rr.com>; Wed,  6 Feb 2013 15:47:57 -0800 (PST)
Received: 	by tift.dreamhost.com (Postfix, from userid 2496696) id 613263200C5; Wed,  6 Feb 2013 15:47:57 -0800 (PST)
X-Cloudmark-Score: 	0
X-Rr-Connecting-Ip: 	208.113.157.41
Message-Id: 	<20130206234757.613263200C5@tift.dreamhost.com>

#2

Looks like there was a 3.5 day lag between relays here at DreamHost.

Switch the $headers to append with “.=”


#3

Thanks, Grizzled Veteran. I made the code change you suggested. I’m glad to have the code clean, but it didn’t affect the problems I’ve been having. What I’ve been figuring out is the DreamHost IP address 208.113.157.44 assigned to my sites keeps getting blocked by various services. It can be seen in http://mxtoolbox.com/SuperTool.aspx?action=blacklist%3A208.113.157.44. Could it be that’s what’s causing the days-long delays and maybe the doubled Return-Path: entries?

Has anyone else felt like the form mail service is very unstable? I haven’t even been able to test settings because of the erratic deliveries. There’s no way to know if a change I made worked or not because it could take days to get the test email feedback.

Thanks again.