diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-03-30 18:04:18 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-03-30 18:04:18 +0000 |
| commit | 015717f7444b3e591e4cbe2f84cfa88dbdcafc13 (patch) | |
| tree | 8e3e545cd9944411e7dbb21aa81fb83b4c3ba00c /roundcubemail/program/steps/mail/sendmail.inc | |
| parent | b0794aa94808eb9bc7110f3212439ca531031e2b (diff) | |
- Fix incorrect word wrapping in outgoing plaintext multibyte messages (#1485714)
- Fix double footer in HTML message with embedded images
git-svn-id: https://svn.roundcube.net/trunk@2368 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/sendmail.inc')
| -rw-r--r-- | roundcubemail/program/steps/mail/sendmail.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/roundcubemail/program/steps/mail/sendmail.inc b/roundcubemail/program/steps/mail/sendmail.inc index eb81fc9ad..9607619e9 100644 --- a/roundcubemail/program/steps/mail/sendmail.inc +++ b/roundcubemail/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 |
