Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

send mail with inline/attachment

by vetrivel (Sexton)
on Mar 15, 2010 at 13:29 UTC ( #828696=perlquestion: print w/ replies, xml ) Need Help??
vetrivel has asked for the wisdom of the Perl Monks concerning the following question:

I have used MIME::Lite program to send a mail with attachments . But I have one problem over here . The problem is that , I am sending a jpg file through mail , My question is that , The attached jpg image should be displayed in inline and attachment . But I got only attachment , in lotus mail client in window . In thundirbird i got both inline and attachment , Herewith I have mentioned the code

use MIME::Lite; $msg = MIME::Lite->new( From => 'testing@mailaddress', To => 'testing1@mailaddress', Subject => 'Testing', Type => 'multipart/mixed' ); $msg->attach( Type => 'TEXT', Data => "Here's the jpeg file you wanted" ); $msg->attach( Type => 'image/jpg', Path => '1.jpg', Filename => 'logo.jpg', Disposition => 'attachment' ); $msg->send('smtp','smtp ip address');

Comment on send mail with inline/attachment
Download Code
Re: send mail with inline/attachment
by Anonymous Monk on Mar 15, 2010 at 13:43 UTC
Re: send mail with inline/attachment
by jfroebe (Vicar) on Mar 15, 2010 at 17:20 UTC

    On a side note, I'd highly recommend checking the MIME type using File::MMagic, or similar, prior to sending it. Just because a file has a ".jpg" extension, doesn't actually guarantee that it is one.

    Just a thought.

    Jason L. Froebe

    Blog, Tech Blog

      Thanks for the reply
      .

      I have checked the jpg file type using File::MMagic . I found that it is a image/jpeg. When i sent this mail through Thunderbird mail client , both the attachment/inline are coming properly to lotus email client in windows . But when i sent through the mentioned program , i got only attachment not inline . but i need inline with attachment

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://828696]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (15)
As of 2014-07-10 12:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (207 votes), past polls