Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.