iceangel Posted August 16, 2009 Share Posted August 16, 2009 Hi all, I have a problem with an html newsletter that i am sending out for a client. When i send the email, the receiver gets the email in duplicate (same content, same time). Here is the php code that sends the brochure: <?php $to_email = $_REQUEST["contactEmail"]; $subject = 'Design Brochure'; $headers = "From:[email protected]\r\n"; $headers .= "Reply-To:[email protected]\r\n"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; ob_start(); include_once("brochure.htm"); $buffer = ob_get_contents(); ob_end_clean(); mail($to_email, $subject, $buffer, $headers); if(mail($to_email, $subject, $buffer, $headers)){ echo "The email was successfully sent."; } else { echo "The email was NOT sent."; } ?> The other issue i have is that the reply email address specified in the header ([email protected]) does not show up in the email. Can anyone please help me? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/170488-mime-newsletter-being-sent-in-duplicate/ Share on other sites More sharing options...
Daniel0 Posted August 16, 2009 Share Posted August 16, 2009 The other issue i have is that the reply email address specified in the header ([email protected]) does not show up in the email. You're overriding the the $header variable in line 6. The reason why it sends it twice is because you call the mail() function twice(in both line 16 and 17). Quote Link to comment https://forums.phpfreaks.com/topic/170488-mime-newsletter-being-sent-in-duplicate/#findComment-899319 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.