summaryrefslogtreecommitdiff
path: root/program/steps/mail/sendmail.inc
diff options
context:
space:
mode:
authortill <till@php.net>2008-03-22 13:55:33 +0000
committertill <till@php.net>2008-03-22 13:55:33 +0000
commit21235274b45c0bef9acc6f95beff0977f0bf2a9d (patch)
tree3fb317324be4b34e2f0d5212fac40307bc9bc944 /program/steps/mail/sendmail.inc
parent0cab801b27abc17bcc6765f586a489fda72bac72 (diff)
* committing fix from #1484506
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r--program/steps/mail/sendmail.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 21b5b4308..7c729ff33 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -245,6 +245,11 @@ if ($isHtml)
// add a plain text version of the e-mail as an alternative part.
$h2t = new html2text($message_body);
$plainTextPart = wordwrap($h2t->get_text(), 998, "\r\n", true);
+ if (!strlen($plainTextPart))
+ {
+ // empty message body breaks attachment handling in drafts
+ $plainTextPart = "\r\n";
+ }
$MAIL_MIME->setTXTBody(html_entity_decode($plainTextPart, ENT_COMPAT, 'utf-8'));
// look for "emoticon" images from TinyMCE and copy into message as attachments
@@ -254,6 +259,11 @@ else
{
$message_body = wordwrap($message_body, 75, "\r\n");
$message_body = wordwrap($message_body, 998, "\r\n", true);
+ if (!strlen($message_body))
+ {
+ // empty message body breaks attachment handling in drafts
+ $message_body = "\r\n";
+ }
$MAIL_MIME->setTXTBody($message_body, FALSE, TRUE);
}