Jump to content

MIME newsletter being sent in duplicate


iceangel

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/170488-mime-newsletter-being-sent-in-duplicate/
Share on other sites

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).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.