geektron has asked for the wisdom of the Perl Monks concerning the following question:
i'm trying to send 'mixed' email: a message where the MUA decides which type to display (HTML or plaintext)
I've read through the perldoc for MIME::Lite and used the following to contruct the email:
the problem with the code: the HTML portion isn't coming through. using 'multipart/mixed' does send both portions, renders the HTML mail, but (as expected) attaches the text portion of the email -- which isn't the behavior i want.my $mailObj = MIME::Lite->new( From => 'admin@domain.com', To => $email, Subject => "subject line here", Type => 'multipart/alternative' ); $mailObj->attach( Type => 'text/html', Data => $htmlMail, ); $mailObj->attach( Type => 'text/plain', Data => $textMail, ); $mailObj->send();
i'm sure i'm missing something, but i'm not sure which direction i need to go.
EDIT: the problem is isolated to Thunderbird. Outlook handles the message appropriately, but Thunderbird ignores the HTML content.
EDIT 2: the problem is Thunderbird. it displays the last recognized MIME type, so if the message is built as above, the text-only portion is displayed. reversing the order builds a message so that Thunderbird does, in fact, display the HTML when 'Show Original HTML' is selected as the preference. (per this mozillazine.org forum post)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: problem w/ MIME::Lite and multipart/alternative emails
by tirwhan (Abbot) on Jan 23, 2006 at 18:47 UTC | |
by geektron (Curate) on Jan 23, 2006 at 18:56 UTC | |
by tirwhan (Abbot) on Jan 23, 2006 at 19:24 UTC | |
by geektron (Curate) on Jan 23, 2006 at 19:54 UTC | |
by thedoe (Monk) on Jan 23, 2006 at 20:41 UTC | |
by geektron (Curate) on Jan 23, 2006 at 20:44 UTC | |
by Anonymous Monk on Apr 11, 2014 at 01:46 UTC | |
Re: problem w/ MIME::Lite and multipart/alternative emails
by helphand (Pilgrim) on Jan 24, 2006 at 04:48 UTC |
Back to
Seekers of Perl Wisdom