summaryrefslogtreecommitdiff
path: root/roundcubemail
diff options
context:
space:
mode:
authortill <till@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-03-22 13:55:33 +0000
committertill <till@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-03-22 13:55:33 +0000
commitc98d44852d6b853e5548aff2b11da71dbf09f38b (patch)
tree4a0913e85e6225dbeb2564bc4e40b588f92c6401 /roundcubemail
parent5b9692499b291effd5b605cab78aa016d7f71005 (diff)
* committing fix from #1484506
git-svn-id: https://svn.roundcube.net/trunk@1210 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail')
-rw-r--r--roundcubemail/program/steps/mail/sendmail.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/roundcubemail/program/steps/mail/sendmail.inc b/roundcubemail/program/steps/mail/sendmail.inc
index 21b5b4308..7c729ff33 100644
--- a/roundcubemail/program/steps/mail/sendmail.inc
+++ b/roundcubemail/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);
}