From 5c873ba9247e08be6626dfb48712245f3bbe4d75 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Mon, 25 Apr 2011 18:50:40 -0400 Subject: [PATCH] Bug Fix for Ticket#1572 / eCard compatability. --- 3.0/modules/phpmailer/libraries/Sendmail.php | 11 +++++++++++ 3.1/modules/phpmailer/libraries/Sendmail.php | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/3.0/modules/phpmailer/libraries/Sendmail.php b/3.0/modules/phpmailer/libraries/Sendmail.php index 289f9aeb..798c28e4 100644 --- a/3.0/modules/phpmailer/libraries/Sendmail.php +++ b/3.0/modules/phpmailer/libraries/Sendmail.php @@ -115,6 +115,17 @@ class Sendmail_Core { $mail->FromName = module::get_var("phpmailer", "phpmailer_from_name"); $mail->AddAddress($to); $mail->IsHTML(true); + + // demdel's fix for the ecard module. + $boundaryLine = explode("\n", $message, -1); + $newboundary = substr($boundaryLine[0],2); + if (preg_match("/--/", $boundaryLine[0])) { + if (preg_match("/--".$newboundary."--/", end($boundaryLine))) { + $mail->CharSet = "UTF-8"; + $mail->ContentType = "multipart/related; boundary=\"".$newboundary."\""; + } + } + $mail->Subject = $subject; $mail->Body = $message; diff --git a/3.1/modules/phpmailer/libraries/Sendmail.php b/3.1/modules/phpmailer/libraries/Sendmail.php index 289f9aeb..798c28e4 100644 --- a/3.1/modules/phpmailer/libraries/Sendmail.php +++ b/3.1/modules/phpmailer/libraries/Sendmail.php @@ -115,6 +115,17 @@ class Sendmail_Core { $mail->FromName = module::get_var("phpmailer", "phpmailer_from_name"); $mail->AddAddress($to); $mail->IsHTML(true); + + // demdel's fix for the ecard module. + $boundaryLine = explode("\n", $message, -1); + $newboundary = substr($boundaryLine[0],2); + if (preg_match("/--/", $boundaryLine[0])) { + if (preg_match("/--".$newboundary."--/", end($boundaryLine))) { + $mail->CharSet = "UTF-8"; + $mail->ContentType = "multipart/related; boundary=\"".$newboundary."\""; + } + } + $mail->Subject = $subject; $mail->Body = $message;