Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form mailed twice

Status
Not open for further replies.

frozenpeas

Technical User
Joined
Sep 13, 2001
Messages
893
Location
CA
Hi,

I am receiving this email twice - the first one is correct, the extra one is blank.

I am submitting the form with this:

Code:
<a href=&quot;javascript:document.form.submit()&quot;>

and my PHP code is:

Code:
$header = &quot;From: &quot;.$row['namef'].&quot; &quot;.$row['namel'].&quot;<&quot;.$row['email'].&quot;>&quot;.&quot;\r\n&quot;
		  .&quot;Reply-To: &quot;.$row['email'].&quot;\r\n&quot;
  		  .&quot;\&quot;MIME-Version: 1.0\&quot;\r\n&quot;
		  .&quot;Content-Type: text/plain;&quot;; 
$boundary = uniqid(&quot;EMAIL&quot;);
$toaddress = 'user@hotmail.com';
$subject = &quot;Submitted event: &quot;.$subject;
$mailcontent = $message;
mail($toaddress, $subject, $mailcontent, $header);

Has anyone had this problem before?

Thanks.

frozenpeas
 
Sorry, I should have mentioned I am on an Apache server.

The funny thing is that this is not happening elsewhere in the site, only from this page.

frozenpeas
 
For troubleshooting:
1. Replace the mail() function with an echo statement.
2. If the echo appears twice, then it's your code.
3. If not, there's something with sendmail and the interpretation of your headers.

I always recommend PHPMailer:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top