summaryrefslogtreecommitdiff
path: root/program/steps/mail/sendmail.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-03-30 18:04:18 +0000
committeralecpl <alec@alec.pl>2009-03-30 18:04:18 +0000
commit7145e009e440ef4d6dcba2b4845656376c9d8ccd (patch)
tree781720e87f351cecef10ed49126c6b1ea6f90077 /program/steps/mail/sendmail.inc
parentdadb05b0afc9a76d4f29a8d35bdf268aa20926df (diff)
- Fix incorrect word wrapping in outgoing plaintext multibyte messages (#1485714)
- Fix double footer in HTML message with embedded images
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r--program/steps/mail/sendmail.inc10
1 files changed, 5 insertions, 5 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index eb81fc9ad..9607619e9 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -302,10 +302,10 @@ if ($isHtml)
$MAIL_MIME->setHTMLBody($message_body . ($footer ? "\r\n<pre>".$footer.'</pre>' : ''));
// add a plain text version of the e-mail as an alternative part.
- $h2t = new html2text($message_body);
- $plainTextPart = $h2t->get_text() . ($footer ? "\r\n".$footer : '');
+ $h2t = new html2text($message_body, false, true, 0);
+ $plainTextPart = rc_wordwrap($h2t->get_text(), 75, "\r\n"). ($footer ? "\r\n".$footer : '');
$plainTextPart = wordwrap($plainTextPart, 998, "\r\n", true);
- if (!strlen($plainTextPart))
+ if (!strlen($plainTextPart))
{
// empty message body breaks attachment handling in drafts
$plainTextPart = "\r\n";
@@ -317,7 +317,7 @@ if ($isHtml)
}
else
{
- $message_body = wordwrap($message_body, 75, "\r\n");
+ $message_body = rc_wordwrap($message_body, 75, "\r\n");
if ($footer)
$message_body .= "\r\n" . $footer;
$message_body = wordwrap($message_body, 998, "\r\n", true);
@@ -342,7 +342,7 @@ if (is_array($_SESSION['compose']['attachments']))
if ($isHtml && ($match > 0))
{
$message_body = preg_replace($dispurl, ' src="'.$attachment['name'].'" ', $message_body);
- $MAIL_MIME->setHTMLBody($message_body. ($footer ? "\r\n<pre>".$footer.'</pre>' : ''));
+ $MAIL_MIME->setHTMLBody($message_body);
$MAIL_MIME->addHTMLImage($attachment['path'], $attachment['mimetype'], $attachment['name']);
}
else