summaryrefslogtreecommitdiff
path: root/program/steps/mail/sendmail.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2007-05-13 18:25:52 +0000
committerthomascube <thomas@roundcube.net>2007-05-13 18:25:52 +0000
commita23884b3d250b9853ce45c2cbb737df6d86895bb (patch)
tree945725f8f6b4203d18642b0bde9c67fe48187e15 /program/steps/mail/sendmail.inc
parent281e3ed325b2e12f0023d9556f4d4e915f21c2cf (diff)
Wrap message body text (closes #1484148)
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r--program/steps/mail/sendmail.inc18
1 files changed, 11 insertions, 7 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index bc454b309..37b57e20e 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -258,7 +258,7 @@ if ($isHtml)
// add a plain text version of the e-mail as an alternative part.
$h2t = new html2text($message_body);
- $plainTextPart = $h2t->get_text();
+ $plainTextPart = wordwrap($h2t->get_text(), 998, "\r\n", true);
$MAIL_MIME->setTXTBody($plainTextPart);
// look for "emoticon" images from TinyMCE and copy into message as attachments
@@ -266,6 +266,8 @@ if ($isHtml)
}
else
{
+ $message_body = wordwrap($message_body, 75, "\r\n");
+ $message_body = wordwrap($message_body, 998, "\r\n", true);
$MAIL_MIME->setTXTBody($message_body, FALSE, TRUE);
}
@@ -286,12 +288,14 @@ $charset_7bit = array('ASCII', 'ISO-2022-JP', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8
$transfer_encoding = in_array(strtoupper($message_charset), $charset_7bit) ? '7bit' : '8bit';
// encoding settings for mail composing
-$message_param = array('text_encoding' => $transfer_encoding,
- 'html_encoding' => 'quoted-printable',
- 'head_encoding' => 'quoted-printable',
- 'head_charset' => $message_charset,
- 'html_charset' => $message_charset,
- 'text_charset' => $message_charset);
+$message_param = array(
+ 'text_encoding' => $transfer_encoding,
+ 'html_encoding' => 'quoted-printable',
+ 'head_encoding' => 'quoted-printable',
+ 'head_charset' => $message_charset,
+ 'html_charset' => $message_charset,
+ 'text_charset' => $message_charset,
+);
// compose message body and get headers
$msg_body = $MAIL_MIME->get($message_param);