Oct 18, 2012, 1:07 PM
Greetings -- guessing this is an 'intermediate question'. Apologies if it is deemed otherwise.
MIME::Lite | 'inline' attachment issue
I'm trying to figure out how to solve several annoying problems with handling inline attachments - specifically, how to resolve (if possible) problems in 'what people see' in the email depending on what flavour/vintage of email client they use.
Consider the following MIME::Lite perl script:
use lib "/usr/local/lib";
$msg = MIME::Lite->new(
From => 'email@example.com',
To => 'firstname.lastname@example.org',
Subject => "test transmission",
ReadNow => 1,
Datestamp => 0,
Disposition => 'inline',
Path => "/path/to/file/test.txt"
As you can see, I'm trying to build an email where the body of the note (i.e., the text of the message) is pulled in from an external file (test.txt).
This works perfectly, except that
1\ in Thunderbird 14.xx or newer, not only do I get the contents of test.txt inline in the note (what I want), but I also get test.txt included as an attachment file (in other words, Thunderbird is treating the contents as 'both' inline and attachment at the same time).
2\ in Outlook pre-2010, the recipient gets test.txt as an attachment, but the body of the email is blank. In Outlook 2010, I get the contents of text.txt inline, but no test.txt as an attachment.
3\ in GMail, the contents of test.txt are inline, and there is the 'icon' for an attachment, but test.txt is not attached.
Is there anything obvious that I could try to resolve this inconsistency? At minimum, I want everyone receiving the note to be able to see the contents of test.txt inline. I've tried scrubbing the msg (as shown above), but turning that on/off doesn't seem to change anything.
I'm also open to suggestions o alternative approaches that may not involve MIME::Lite.
Thanks in advance.