[thelist] Double Emails continued in PHP

Jay Blanchard jay.blanchard at niicommunications.com
Fri Jul 18 06:42:30 CDT 2003


[snip]
> $subject = "Evolt PHP Mail Test";
> $headers = "MIME-Version: 1.0\r\n";
> $headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
> $headers.= "From: ".$myname."<".$myemail.">\r\n";
> $headers.= "To: ".$contactname."<".$contactemail.">\r\n";
>
> mail($contactemail, $subject, $message, $headers);
> ?>

Erm, this is dead easy:

the mail function is

mail( to, subject, body, extraheaders )

So, you've already got one recipient with your call:

mail( $contactemail, ... )

but then you've also added a "To:" header in $headers, which you add in 
your call.
[/snip]

Excellent catch Seb!

<tip type=PHP>
Are you having problems with a small section of code? If possible
isolate the code and add error_reporting(E_ALL) as the top line of the
code. Run the code and start commenting out one line at a time (if
possible without breaking execution)  and re-running the code until the
error disappears. 
</php>



More information about the thelist mailing list