guymclaren Posted September 19, 2008 Share Posted September 19, 2008 // From email address $from = "xxx@xxxx"; $from_name = "xxxxx"; // The message $subject = "Your ORDER needs confirming"; $message = " <html> <head> <title>Order Confirmation, webTECH.co.za</title> </head> <body> <p>Dear $fname</p> <p>You are receiving this email because you have just placed an order for a website at webTECH</p> <p>Please confirm this order by clicking the link below this.<br> <a href=\"http://webtech.co.za/confirm.php?id=$affid&pay=$pay\">www.webtech.co.za/confirm.asp?id=$affid</a></p> <p>Regards</p> <p>webTECH</p> <p>Tel 013 745 8337</p> <p>Cell 071 604 7754</p> </body> </html> "; // Headers // To send HTML mail, the Content-type header must be set $headers = "To: ".$fname."<".$email.">" . "\r\n"; $headers .= "From: ".$from_name." <".$from.">" . "\r\n"; $headers .= "Date: ".date("r") . "\r\n"; // Additional headers $headers .= "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n"; $headers .= "Message-Id: <".md5(uniqid(microtime()))."@".$_SERVER["SERVER_NAME"].">\r\n"; // Send the mail mail($email, $subject, $message, $headers); Link to comment https://forums.phpfreaks.com/topic/124968-solved-why-is-this-duplicating-the-email/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 19, 2008 Share Posted September 19, 2008 Because the first parameter in the mail() function is the To: address and you are also putting a To: address in the headers, so you get the email sent to that address twice. Link to comment https://forums.phpfreaks.com/topic/124968-solved-why-is-this-duplicating-the-email/#findComment-645798 Share on other sites More sharing options...
guymclaren Posted September 20, 2008 Author Share Posted September 20, 2008 Thank you, so in effect removing from either function should get it sent only once or should I remove it from the headers in preference? Link to comment https://forums.phpfreaks.com/topic/124968-solved-why-is-this-duplicating-the-email/#findComment-646321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.