Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Email With Attachment

by tphyahoo (Vicar)
on Mar 08, 2007 at 18:01 UTC ( #603867=note: print w/replies, xml ) Need Help??

in reply to Email With Attachment

mime lite for attachments demo:
#!/usr/bin/perl # use warnings; use strict; use MIME::Lite; use Net::SMTP; my $from = ''; my $to = ''; my $msg = MIME::Lite->new( From => $from, TO => $to, Subject => 'Testing Text Message ', Type =>'multipart/mixed', ); $msg->attach( Type =>'TEXT', Data =>"Mime message with attachment, sent with Net: +:SMTP" ); $msg->attach(Type =>'image/gif', Path =>'1.jpg', Filename =>'1.jpg', Disposition => 'attachment' ); $msg->attach(Type =>' text/tab-separated-values', Path =>'./2.csv', Filename =>'2.csv', Disposition => 'attachment' ); my $Servername = ""; my $smtp = Net::SMTP->new($Servername); $smtp->mail($from); $smtp->to($to); my $msg_stringified = $msg->as_string(); $smtp -> data( $msg_stringified ) || warn("error sending email message +:" . $msg_stringified ); $smtp -> quit;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://603867]
[GrandFather]: It's either lines that your browser won't split (no white space) or nodes with <pre> tags which ought to be code tags
[GrandFather]: I haven't noticed the problem for a while, but it can be hard to find the nasty node. If you do find it, consider it and with luck a janitor will fix it

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2017-05-24 00:56 GMT
Find Nodes?
    Voting Booth?