Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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');

Replies are listed 'Best First'.
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 (Parson) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://828696]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2018-06-25 06:37 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.