Swift 4.0.6: Multipart HTML + TXT: Text version does not show in Thunderbird
Reported by Jay | April 29th, 2010 @ 06:32 PM
Hi!
I create a Message with
$transport = Swift_SmtpTransport::newInstance($smtp_server, 25);
$swift = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance();
$message->setCharset('utf-8');
$headers = $message->getHeaders();
.....
$message->setBody($sHTMLMessagebody, 'text/html');
$message->addPart($sTxtMessagebody, 'text/plain');
and it works fine so far e.g. in Outlook. Both versions work. But
in Thunderbird (3.0.4) the Text Version ist not shown as
alternative. Thunderbird parses the HTML to TXT instead of showing
the attached Text Version.
Return-Path:
Received: from murder ([unix socket])
by bm9 (Cyrus v2.2.13-Mandriva-RPM-2.2.13-4mdv2007.0) with LMTPA;
Thu, 29 Apr 2010 10:09:17 +0200
X-Sieve: CMU Sieve 2.2
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="_=_swift_v4_12725285864bd93ecabcf7c_=_"; type="multipart/related"
--_=_swift_v4_12725285864bd93ecabcf7c_=_
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
TXT GOES HERE
--_=_swift_v4_12725285864bd93ecabcf7c_=_
Content-Type: multipart/related;
boundary="_=_swift_v4_12725285864bd93ecaee85e_=_"
--_=_swift_v4_12725285864bd93ecaee85e_=_
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
HTML GOES HERE
--_=_swift_v4_12725285864bd93ecaee85e_=_
Content-Type: image/gif; name=xxxx.gif
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=xxxx.gif
AND SO ON...
Comments and changes to this ticket
-

softjury September 24th, 2010 @ 12:20 AM
Please try with
$message->setBody($sTxtMessagebody, 'text/plain'); $message->addPart($sHTMLMessagebody, 'text/html');
-

softjury September 24th, 2010 @ 12:22 AM
Please try with
$message->setBody($sTxtMessagebody, 'text/plain'); $message->addPart($sHTMLMessagebody, 'text/html');This will put the body second and plain first.
-
xdecock March 23rd, 2011 @ 09:16 PM
- → State changed from new to hold
But I suspect this is more a kind of Thunderbird "Feature" as most in the wild HTML + Text content usually are more a kind of
Click here if your mail client does not support HTML to view the newsletter : http://test.com/
This must be the root cause of downgrading the html to display text.
Not sure we can fix this by any mean
And the extract of mail source you give to me seems legit.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Comprehensive mailing tools for PHP 5.