phpmailer - HTML conversion issue while sending multiple mails in php mailer -



phpmailer - HTML conversion issue while sending multiple mails in php mailer -

we facing 1 issue while sending 1 1 mail service through loop using php mailer. whenver sending mails 1 1 , body of mail service part getting encoded recepient , other others body part coming fine. please have in code have used.

seek { $mail = new phpmailer(true); //new instance, exceptions enabled $mail->charset = "text/html; charset=utf-8;"; $mail->issmtp(); // tell class utilize smtp $mail->charset='utf-8'; $mail->smtpauth = true; // enable smtp authentication $mail->port = 465; // set smtp server port $mail->host = "ssl://smtp.googlemail.com"; // smtp server $mail->username = "mylogin@gmail.com"; // smtp server username $mail->password = "mylogin"; // smtp server password $mail->from = "testo@host.com"; $mail->fromname = "$frommailid"; $mail->encoding = 'base64'; $mail->contenttype = 'text/html; charset=utf-8\r\n'; $to =$offmailid; if($ccmailid!='') { $mail->addcc($ccmailid); } $to='test@gmail.com'; $mail->addaddress($to); $mail->subject =$subject; $mail->altbody = "to view message, please utilize html compatible email viewer!"; // optional, comment out , test $mail->wordwrap = 80; // set word wrap $mail->msghtml($body); $mail->ishtml(true); // send html $mail->send(); //echo "mail sent"; } grab (phpmailerexception $e) { // echo $e->errormessage(); } output : y="----=nextpart_1413635021" ------=nextpart_1413635021 content-type: multipart/alternative; boundary="b1_d42b7a92f948fa93f11ba35ba7f81fe2" --b1_d42b7a92f948fa93f11ba35ba7f81fe2 content-type: text/plain; charset=utf-8 content-transfer-encoding: base64 vg8gdmlldyb0agugbwvzc2fnzswgcgxlyxnlihvzzsbhbibive1mignvbxbhdglibgugzw1hawwg dmlld2vyiq0k --b1_d42b7a92f948fa93f11ba35ba7f81fe2 content-type: text/html; charset=utf-8 content-transfer-encoding: base64 rgvhcibuzxn0zw1wbg95zwugldxicj48yni+iflvdxigbgvhdmugznjvbsbpy3qgmjesmjaxncb0 bybpy3qgmjesmjaxncbhchbsawvkig9uie9jdcaxocwymde0ighhcybizwvuigfwchjvdmvkljxi cj48yni+q29tbwvudhmgojxicj48yni+ifjlz2fyzhmspgjyplnoaw1uysbdpgjyplnvznr3yxjl ievuz2luzwvypgjypg== --b1_d42b7a92f948fa93f11ba35ba7f81fe2-- ------=nextpart_1413635021 content-type: text/plain;

several things wrong here - you're trying things phpmailer doing you, , breaking it.

most obvious thing setting contenttype - don't that.

calling msghtml sets ishtml , sets altbody, don't need them either.

i'd suggest don't utilize base of operations 64 encoding - utilize quoted-printable encoding.

don't utilize ssl on port 465. utilize tls on port 587.

this looks started old illustration - running latest github?

phpmailer

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -