CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
MIME::Lite | 'inline' attachment issue

 



cooch17
New User

Oct 18, 2012, 1:07 PM

Post #1 of 1 (1263 views)
MIME::Lite | 'inline' attachment issue Can't Post

Greetings -- guessing this is an 'intermediate question'. Apologies if it is deemed otherwise.

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:

#!/usr/bin/perl
use lib "/usr/local/lib";
use MIME::Lite;

$msg = MIME::Lite->new(
From => 'fred@bedrock.com',
To => 'barney@bedrock.com',
Subject => "test transmission",
Type =>'text/plain',
ReadNow => 1,
Datestamp => 0,
Disposition => 'inline',
Path => "/path/to/file/test.txt"
);

# $msg->scrub(['content-disposition']);
$msg->send;


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.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives