xox Posted March 29, 2011 Share Posted March 29, 2011 Hello, I'm using phpmailer for this job, and what I want is that in first mail user gets only text and in second he gets text with attachment. But code below is only sending me the mail with attachment(second mail), what is cosing this problem? Here's the code for ($i=0; $i<2; $i++) { if (!class_exists("phpmailer")) { require("PHPMailer/class.phpmailer.php"); } if ($price != 0 ) { $mail = new PHPMailer(); $mail->CharSet = 'UTF-8'; $mail->From = "[email protected]"; $mail->FromName = "Company"; $mail->AddAddress($email, ""); $mail->WordWrap = 50; $mail->IsHTML(true); $mail->Subject = "Subjcet"; $mail->Body = $content; } if ($i == 1 || $price == 0 ) { //require("PHPMailer/class.phpmailer.php"); $mail = new PHPMailer(); $mail->CharSet = 'UTF-8'; $mail->From = "[email protected]"; $mail->FromName = "Company"; $mail->AddAddress($email, ""); $mail->WordWrap = 50; $mail->IsHTML(true); $mail->Subject = "Subjcet"; $mail->Addattachment ("file/patch".$fileName, ); // patch and name of an attachment } } Link to comment https://forums.phpfreaks.com/topic/232098-sending-multiple-emails-with-phpmailer/ Share on other sites More sharing options...
xox Posted March 30, 2011 Author Share Posted March 30, 2011 no one? Link to comment https://forums.phpfreaks.com/topic/232098-sending-multiple-emails-with-phpmailer/#findComment-1194165 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.