<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Problem sending mail with PHP mail function</title>
	<atom:link href="http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/</link>
	<description>Experiments and thoughts in PHP and javascript</description>
	<lastBuildDate>Mon, 30 Jan 2012 20:33:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: scarpe hogan</title>
		<link>http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/comment-page-1/#comment-2926</link>
		<dc:creator>scarpe hogan</dc:creator>
		<pubDate>Mon, 30 Jan 2012 20:33:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=220#comment-2926</guid>
		<description>having the same problem</description>
		<content:encoded><![CDATA[<p>having the same problem</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gdfgdfgdfg</title>
		<link>http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/comment-page-1/#comment-2905</link>
		<dc:creator>gdfgdfgdfg</dc:creator>
		<pubDate>Sat, 03 Dec 2011 09:23:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=220#comment-2905</guid>
		<description>dfgdfg</description>
		<content:encoded><![CDATA[<p>dfgdfg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hamad</title>
		<link>http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/comment-page-1/#comment-2375</link>
		<dc:creator>Hamad</dc:creator>
		<pubDate>Tue, 30 Aug 2011 06:03:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=220#comment-2375</guid>
		<description>Struggled with this issue for a while!

Thank you for sharing the solution.</description>
		<content:encoded><![CDATA[<p>Struggled with this issue for a while!</p>
<p>Thank you for sharing the solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gerbie Pejo</title>
		<link>http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/comment-page-1/#comment-2151</link>
		<dc:creator>Gerbie Pejo</dc:creator>
		<pubDate>Mon, 15 Aug 2011 13:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=220#comment-2151</guid>
		<description>can anyone help me with this, can&#039;t send email using this php code...


&lt;?php
error_reporting(0);
// &#039; Send me an email&#039; script



if($_POST[&#039;submit&#039;])

{
//get data from form
$name = $_POST[&#039;name&#039;];
$message = $_POST[&#039;message&#039;];

if($name&amp;&amp;$message)
{  // existance check
$namelen = 20;
$messagelen = 300;
if(strlen($name)&lt;=$namelen&amp;&amp;strlen($message)&lt;=$messagelen) // length check
{
// everything is ok!

//set SMTP in php.ini

ini_set(&quot;SMTP&quot;,&quot;mail.domain.com&quot;);
ini_set(&quot;smtp_port&quot;,25);

//set up the variables
$to = &quot;gerbiepejo@yahoo.com&quot;;
$subject = &quot;Email from Clarissa Jade Village Resort&quot;;
$header = &quot;From: ClarissaJade@yahoo.com&quot;;


$body = &quot;This is an email from $name\n\n$message&quot;;
mail($to, $subject, $body, $header);

die();
}

else
	die(&quot;Max length for name is $namelen, and max length for message is $messagelen!&quot;);
}
else
	die(&quot;You must enter your name and mesage&quot;);
}

?&gt;



	
		Name: 
		Message:
		
	


thanks in advance!</description>
		<content:encoded><![CDATA[<p>can anyone help me with this, can&#8217;t send email using this php code&#8230;</p>
<p>&lt;?php<br />
error_reporting(0);<br />
// &#039; Send me an email&#039; script</p>
<p>if($_POST[&#039;submit&#039;])</p>
<p>{<br />
//get data from form<br />
$name = $_POST[&#039;name&#039;];<br />
$message = $_POST[&#039;message&#039;];</p>
<p>if($name&amp;&amp;$message)<br />
{  // existance check<br />
$namelen = 20;<br />
$messagelen = 300;<br />
if(strlen($name)&lt;=$namelen&amp;&amp;strlen($message)&lt;=$messagelen) // length check<br />
{<br />
// everything is ok!</p>
<p>//set SMTP in php.ini</p>
<p>ini_set(&quot;SMTP&quot;,&quot;mail.domain.com&quot;);<br />
ini_set(&quot;smtp_port&quot;,25);</p>
<p>//set up the variables<br />
$to = &quot;gerbiepejo@yahoo.com&quot;;<br />
$subject = &quot;Email from Clarissa Jade Village Resort&quot;;<br />
$header = &quot;From: <a href="mailto:ClarissaJade@yahoo.com">ClarissaJade@yahoo.com</a>&quot;;</p>
<p>$body = &quot;This is an email from $name\n\n$message&quot;;<br />
mail($to, $subject, $body, $header);</p>
<p>die();<br />
}</p>
<p>else<br />
	die(&quot;Max length for name is $namelen, and max length for message is $messagelen!&quot;);<br />
}<br />
else<br />
	die(&quot;You must enter your name and mesage&#8221;);<br />
}</p>
<p>?&gt;</p>
<p>		Name:<br />
		Message:</p>
<p>thanks in advance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: parul</title>
		<link>http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/comment-page-1/#comment-2039</link>
		<dc:creator>parul</dc:creator>
		<pubDate>Sun, 26 Jun 2011 08:12:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=220#comment-2039</guid>
		<description>hi!
i am using apache2.2 with php on port 80 on windows7
php mail() function not able to send at my gmail account
i am working on localhost

please help me to get out this stuff
thanks in advance</description>
		<content:encoded><![CDATA[<p>hi!<br />
i am using apache2.2 with php on port 80 on windows7<br />
php mail() function not able to send at my gmail account<br />
i am working on localhost</p>
<p>please help me to get out this stuff<br />
thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julio Osorio</title>
		<link>http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/comment-page-1/#comment-2038</link>
		<dc:creator>Julio Osorio</dc:creator>
		<pubDate>Sun, 26 Jun 2011 07:01:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=220#comment-2038</guid>
		<description>Nice post, that&#039;s a really good tip I was looking for. Thanks a lot.</description>
		<content:encoded><![CDATA[<p>Nice post, that&#8217;s a really good tip I was looking for. Thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: parul</title>
		<link>http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/comment-page-1/#comment-2037</link>
		<dc:creator>parul</dc:creator>
		<pubDate>Fri, 24 Jun 2011 19:09:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=220#comment-2037</guid>
		<description>hi!
i am using apache2.2 with php on port 80 on windows7
php mail() function not able to send at my gmail account 
i am working on localhost


please help me to get out this stuff
thanks in advance</description>
		<content:encoded><![CDATA[<p>hi!<br />
i am using apache2.2 with php on port 80 on windows7<br />
php mail() function not able to send at my gmail account<br />
i am working on localhost</p>
<p>please help me to get out this stuff<br />
thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Orion</title>
		<link>http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/comment-page-1/#comment-2029</link>
		<dc:creator>Orion</dc:creator>
		<pubDate>Mon, 06 Jun 2011 08:45:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=220#comment-2029</guid>
		<description>lastly, here&#039;s the QMail log indicating the problem...

Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: Handlers Filter before-queue for qmail started ...

Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: from=

Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: to=orionculver@b-street.co.uk

Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: hook_dir = &#039;/var/qmail//handlers/before-queue&#039;

Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: recipient[3] = &#039;orionculver@b-street.co.uk&#039;

Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: handlers dir = &#039;/var/qmail//handlers/before-queue/recipient/orionculver@b-street.co.uk&#039;

Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: starter: submitter[1148] exited normally

Jun  3 10:13:48 342812-web2 qmail: 1307092428.798059 bounce msg 18353656 qp 1147

Jun  3 10:13:48 342812-web2 qmail: 1307092428.798116 end msg 18353656

Jun  3 10:13:48 342812-web2 qmail: 1307092428.798338 new msg 18353663

Jun  3 10:13:48 342812-web2 qmail: 1307092428.798366 info msg 18353663: bytes 4902 from  qp 1148 uid 2522

Jun  3 10:13:48 342812-web2 qmail: 1307092428.800937 starting delivery 2481: msg 18353663 to remote orionculver@b-street.co.uk

Jun  3 10:13:48 342812-web2 qmail: 1307092428.801071 status: local 0/10 remote 2/20

Jun  3 10:13:48 342812-web2 qmail-remote-handlers[1149]: Handlers Filter before-remote for qmail started ...

Jun  3 10:13:48 342812-web2 qmail-remote-handlers[1149]: from=

Jun  3 10:13:48 342812-web2 qmail-remote-handlers[1149]: to=orionculver@b-street.co.uk

Jun  3 10:13:50 342812-web2 qmail: 1307092430.526801 delivery 2481: success: 98.129.184.131_accepted_message./Remote_host_said:_250_OK_BD/F0-16184-DC5A8ED4/

Jun  3 10:13:50 342812-web2 qmail: 1307092430.526909 status: local 0/10 remote 1/20

Jun  3 10:13:50 342812-web2 qmail: 1307092430.526938 end msg 18353663

Jun  3 10:13:50 342812-web2 qmail: 1307092430.576988 delivery 2480: success: 98.129.184.131_accepted_message./Remote_host_said:_250_2.0.0_Ok:_queued_as_6D/F0-16184-DC5A8ED4/</description>
		<content:encoded><![CDATA[<p>lastly, here&#8217;s the QMail log indicating the problem&#8230;</p>
<p>Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: Handlers Filter before-queue for qmail started &#8230;</p>
<p>Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: from=</p>
<p>Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: to=orionculver@b-street.co.uk</p>
<p>Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: hook_dir = &#8216;/var/qmail//handlers/before-queue&#8217;</p>
<p>Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: recipient[3] = &#8216;orionculver@b-street.co.uk&#8217;</p>
<p>Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: handlers dir = &#8216;/var/qmail//handlers/before-queue/recipient/orionculver@b-street.co.uk&#8217;</p>
<p>Jun  3 10:13:48 342812-web2 qmail-queue-handlers[1147]: starter: submitter[1148] exited normally</p>
<p>Jun  3 10:13:48 342812-web2 qmail: 1307092428.798059 bounce msg 18353656 qp 1147</p>
<p>Jun  3 10:13:48 342812-web2 qmail: 1307092428.798116 end msg 18353656</p>
<p>Jun  3 10:13:48 342812-web2 qmail: 1307092428.798338 new msg 18353663</p>
<p>Jun  3 10:13:48 342812-web2 qmail: 1307092428.798366 info msg 18353663: bytes 4902 from  qp 1148 uid 2522</p>
<p>Jun  3 10:13:48 342812-web2 qmail: 1307092428.800937 starting delivery 2481: msg 18353663 to remote <a href="mailto:orionculver@b-street.co.uk">orionculver@b-street.co.uk</a></p>
<p>Jun  3 10:13:48 342812-web2 qmail: 1307092428.801071 status: local 0/10 remote 2/20</p>
<p>Jun  3 10:13:48 342812-web2 qmail-remote-handlers[1149]: Handlers Filter before-remote for qmail started &#8230;</p>
<p>Jun  3 10:13:48 342812-web2 qmail-remote-handlers[1149]: from=</p>
<p>Jun  3 10:13:48 342812-web2 qmail-remote-handlers[1149]: to=orionculver@b-street.co.uk</p>
<p>Jun  3 10:13:50 342812-web2 qmail: 1307092430.526801 delivery 2481: success: 98.129.184.131_accepted_message./Remote_host_said:_250_OK_BD/F0-16184-DC5A8ED4/</p>
<p>Jun  3 10:13:50 342812-web2 qmail: 1307092430.526909 status: local 0/10 remote 1/20</p>
<p>Jun  3 10:13:50 342812-web2 qmail: 1307092430.526938 end msg 18353663</p>
<p>Jun  3 10:13:50 342812-web2 qmail: 1307092430.576988 delivery 2480: success: 98.129.184.131_accepted_message./Remote_host_said:_250_2.0.0_Ok:_queued_as_6D/F0-16184-DC5A8ED4/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Orion</title>
		<link>http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/comment-page-1/#comment-2028</link>
		<dc:creator>Orion</dc:creator>
		<pubDate>Mon, 06 Jun 2011 08:43:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=220#comment-2028</guid>
		<description>given responses on other forums, Here&#039;s the most pertinent code:

	function UserToSiteEmail( $name, $fromEmail, $message, $kidID, $kidName )
	{
		$subject = &quot;Face of Kinder - contact us&quot;;
		$headers = GetEmailHeaders($fromEmail);
		$imageFilename = constant(&quot;URL_ROOT&quot;).&quot;/kidimages/&quot;.$kid-&gt;ImageFilename;
		$profileUrl = constant(&quot;URL_ROOT&quot;).&quot;/profile.php?k=&quot;.$kid-&gt;KidID;
		$body = file_get_contents(&quot;EmailTemplates/ContactUs.html&quot;);
		$body = str_replace(&quot;#FromName#&quot;,$name,$body);
		$body = str_replace(&quot;#FromEmail#&quot;,$fromEmail,$body);
		$body = str_replace(&quot;#KidName#&quot;,$kidName,$body);
		$body = str_replace(&quot;#KidID#&quot;,$kidID,$body);
		$body = str_replace(&quot;#Message#&quot;,$message,$body);
		$body = str_replace(&quot;#SiteRoot#&quot;,constant(&quot;URL_ROOT&quot;),$body);
		return mail(constant(&quot;FROM_EMAIL&quot;),$subject,$body,$headers);
	}

    function GetEmailHeaders( $fromEmail )
    {
	$headers = &quot;From: Face of Kinder &quot; . PHP_EOL;
	$headers .= &quot;Reply-To: &quot; . $fromEmail . PHP_EOL;
	$headers .= &quot;Return-Path: &quot; . $fromEmail . PHP_EOL;
	$headers .= &#039;MIME-Version: 1.0&#039; . PHP_EOL;
	$headers .= &#039;Content-type: text/html; charset=iso-8859-1&#039; . PHP_EOL;
	
	return $headers;
    }

The UserToSiteEmail() funct uses the data from the contact us form, where the $fromEmail param is the email entered in the form. From what Rackspace could find in the QMail logs was that when the 2nd use of the same email in the contact us form gets submitted, the email in the form ends up in the To field, not in the headers, &amp; the email inbox&#039;s address didn&#039;t show anywhere (not even the headers - i.e., it didn&#039;t swap).  This is even though the same code correctly put the form&#039;s email into the header, &amp; the email inbox&#039;s address in the To field on the 1st submitting of the form (per browser).

I can add the HTML side of the form if needed, but in terms of its process, after the form is submitted back to itself, after validating &amp; emailing, the php redirects to a thanks page.  I&#039;m not certain how GET &amp; POST variables would persist after the thank you page, as the only way back to the page is to click the link for the contact form again.  To see the current process (without the problem - as it only seems to crop up when using the email inbox&#039;s domain), here&#039;s a link to a page with the contact us link in the footer:  http://www.faceofkinder.com/home.php.

- O8</description>
		<content:encoded><![CDATA[<p>given responses on other forums, Here&#8217;s the most pertinent code:</p>
<p>	function UserToSiteEmail( $name, $fromEmail, $message, $kidID, $kidName )<br />
	{<br />
		$subject = &#8220;Face of Kinder &#8211; contact us&#8221;;<br />
		$headers = GetEmailHeaders($fromEmail);<br />
		$imageFilename = constant(&#8220;URL_ROOT&#8221;).&#8221;/kidimages/&#8221;.$kid-&gt;ImageFilename;<br />
		$profileUrl = constant(&#8220;URL_ROOT&#8221;).&#8221;/profile.php?k=&#8221;.$kid-&gt;KidID;<br />
		$body = file_get_contents(&#8220;EmailTemplates/ContactUs.html&#8221;);<br />
		$body = str_replace(&#8220;#FromName#&#8221;,$name,$body);<br />
		$body = str_replace(&#8220;#FromEmail#&#8221;,$fromEmail,$body);<br />
		$body = str_replace(&#8220;#KidName#&#8221;,$kidName,$body);<br />
		$body = str_replace(&#8220;#KidID#&#8221;,$kidID,$body);<br />
		$body = str_replace(&#8220;#Message#&#8221;,$message,$body);<br />
		$body = str_replace(&#8220;#SiteRoot#&#8221;,constant(&#8220;URL_ROOT&#8221;),$body);<br />
		return mail(constant(&#8220;FROM_EMAIL&#8221;),$subject,$body,$headers);<br />
	}</p>
<p>    function GetEmailHeaders( $fromEmail )<br />
    {<br />
	$headers = &#8220;From: Face of Kinder &#8221; . PHP_EOL;<br />
	$headers .= &#8220;Reply-To: &#8221; . $fromEmail . PHP_EOL;<br />
	$headers .= &#8220;Return-Path: &#8221; . $fromEmail . PHP_EOL;<br />
	$headers .= &#8216;MIME-Version: 1.0&#8242; . PHP_EOL;<br />
	$headers .= &#8216;Content-type: text/html; charset=iso-8859-1&#8242; . PHP_EOL;</p>
<p>	return $headers;<br />
    }</p>
<p>The UserToSiteEmail() funct uses the data from the contact us form, where the $fromEmail param is the email entered in the form. From what Rackspace could find in the QMail logs was that when the 2nd use of the same email in the contact us form gets submitted, the email in the form ends up in the To field, not in the headers, &amp; the email inbox&#8217;s address didn&#8217;t show anywhere (not even the headers &#8211; i.e., it didn&#8217;t swap).  This is even though the same code correctly put the form&#8217;s email into the header, &amp; the email inbox&#8217;s address in the To field on the 1st submitting of the form (per browser).</p>
<p>I can add the HTML side of the form if needed, but in terms of its process, after the form is submitted back to itself, after validating &amp; emailing, the php redirects to a thanks page.  I&#8217;m not certain how GET &amp; POST variables would persist after the thank you page, as the only way back to the page is to click the link for the contact form again.  To see the current process (without the problem &#8211; as it only seems to crop up when using the email inbox&#8217;s domain), here&#8217;s a link to a page with the contact us link in the footer:  <a href="http://www.faceofkinder.com/home.php" rel="nofollow">http://www.faceofkinder.com/home.php</a>.</p>
<p>- O8</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Orion</title>
		<link>http://www.dotvoid.com/2007/04/problem-sending-mail-with-php-mail-function/comment-page-1/#comment-2027</link>
		<dc:creator>Orion</dc:creator>
		<pubDate>Fri, 03 Jun 2011 12:15:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=220#comment-2027</guid>
		<description>Heya,

I hoping someone will be able to help me, as I&#039;m at a loss as to what is causing the problem.
Our website has a contact us form, with fields for name, email, kid name, kid ID, &amp; message.
When the form submits, the server side php code validates the form fields, &amp; if all is good, uses the built in php mail() function to send 2 emails.
Email 1 goes to an inbox on a hosted exchange server containing the values in the form fields.
Email 2 goes to the person submitting the form saying thanks - we&#039;ll get back to you shortly.
For email 1, the From, Reply-To, &amp; Return-Path headers are set to the email entered in the form, &amp; the To param in the mail() function is the email address of the inbox of the hosted exchange server.
For email 2, the From, Reply-To, &amp; Return-Path headers are set to the email address of the inbox on the hosted exchange server, &amp; the To param in the mail() function is the email address entered in the form.
The website&#039;s host has the MX, PTR, SPF, &amp; TXT records set up properly to allow emails to be sent to &amp; from the email address of the inbox of the hosted exchange server.
The website&#039;s host uses QMail as the SMTP service that actually sends the emails, &amp; in all tests, QMail is receiving a success when sending both email 1 &amp; 2.  There is no error issued by the mail() function.

Local tests were done with IE8, Chrome, &amp; FF3.6.17.  The code was not changed between tests showing this problem.
In all test cases, email 2 (back to the person submitting the form) is sent just fine.
Email 1, on the other hand, is only intermittently working.  The general pattern is that the 1st time the contact form is used with each distinct email address in the form, the email is sent fine, &amp; the headers &amp; to are correct.
The 2nd time the contact form is used with a previously used email address in the form, the To param is set to the email address in the form, the headers are all blank, &amp; in spite of the To email address being incorrect, the email is not received.
The website&#039;s host&#039;s support staff may have found another potential symptom, which is that after clearing cookies, all the email 2&#039;s got through ok.  However, the page does not use any cookies in relation to the form.
Lastly, I tried again a while (30 mins?) after email 2&#039;s weren&#039;t getting through, then another try worked, after which the email 2&#039;s screwed up as described above again.

Is there a known bug with php&#039;s mail() function along these lines?  Is there a maximum frequency at which mail() can be used?
I&#039;m at a loss as to why the code sometimes works, &amp; sometimes doesn&#039;t.  The website&#039;s host&#039;s staff are at a loss, as well.
Trying to google this issue seems to turn up forums of people saying to use different modules (Swift Mailer, PHPMailer, Pear Mail, etc.), but as the website is live, I&#039;m wary that rebuilding the automated emailing code will introduce errors beyond the one described above.

- O8</description>
		<content:encoded><![CDATA[<p>Heya,</p>
<p>I hoping someone will be able to help me, as I&#8217;m at a loss as to what is causing the problem.<br />
Our website has a contact us form, with fields for name, email, kid name, kid ID, &amp; message.<br />
When the form submits, the server side php code validates the form fields, &amp; if all is good, uses the built in php mail() function to send 2 emails.<br />
Email 1 goes to an inbox on a hosted exchange server containing the values in the form fields.<br />
Email 2 goes to the person submitting the form saying thanks &#8211; we&#8217;ll get back to you shortly.<br />
For email 1, the From, Reply-To, &amp; Return-Path headers are set to the email entered in the form, &amp; the To param in the mail() function is the email address of the inbox of the hosted exchange server.<br />
For email 2, the From, Reply-To, &amp; Return-Path headers are set to the email address of the inbox on the hosted exchange server, &amp; the To param in the mail() function is the email address entered in the form.<br />
The website&#8217;s host has the MX, PTR, SPF, &amp; TXT records set up properly to allow emails to be sent to &amp; from the email address of the inbox of the hosted exchange server.<br />
The website&#8217;s host uses QMail as the SMTP service that actually sends the emails, &amp; in all tests, QMail is receiving a success when sending both email 1 &amp; 2.  There is no error issued by the mail() function.</p>
<p>Local tests were done with IE8, Chrome, &amp; FF3.6.17.  The code was not changed between tests showing this problem.<br />
In all test cases, email 2 (back to the person submitting the form) is sent just fine.<br />
Email 1, on the other hand, is only intermittently working.  The general pattern is that the 1st time the contact form is used with each distinct email address in the form, the email is sent fine, &amp; the headers &amp; to are correct.<br />
The 2nd time the contact form is used with a previously used email address in the form, the To param is set to the email address in the form, the headers are all blank, &amp; in spite of the To email address being incorrect, the email is not received.<br />
The website&#8217;s host&#8217;s support staff may have found another potential symptom, which is that after clearing cookies, all the email 2&#8217;s got through ok.  However, the page does not use any cookies in relation to the form.<br />
Lastly, I tried again a while (30 mins?) after email 2&#8217;s weren&#8217;t getting through, then another try worked, after which the email 2&#8217;s screwed up as described above again.</p>
<p>Is there a known bug with php&#8217;s mail() function along these lines?  Is there a maximum frequency at which mail() can be used?<br />
I&#8217;m at a loss as to why the code sometimes works, &amp; sometimes doesn&#8217;t.  The website&#8217;s host&#8217;s staff are at a loss, as well.<br />
Trying to google this issue seems to turn up forums of people saying to use different modules (Swift Mailer, PHPMailer, Pear Mail, etc.), but as the website is live, I&#8217;m wary that rebuilding the automated emailing code will introduce errors beyond the one described above.</p>
<p>- O8</p>
]]></content:encoded>
	</item>
</channel>
</rss>

