Please browse through faq219-2884 and faq219-2889 first. Comments on this FAQ and the General FAQ are very welcome.
use MIME::Lite;
### Create a new multipart message:
$msg = MIME::Lite->new(
From =>'me@myhost.com',
To =>'you@yourhost.com',
Cc =>'some@other.com, some@more.com',
Subject =>'A message with 2 parts...',
Type =>'multipart/mixed'
);
### Add parts (each "attach" has same arguments as "new"):
$msg->attach(
Type =>'TEXT',
Data =>"Here's the GIF file you wanted"
);
$msg->attach(
Type =>'image/gif',
Path =>'/usr/local/tmp/aaa000123.gif',
Filename =>'logo.gif'
);
$text = $msg->as_string;
## MIME::Lite also includes a method for sending these
## things.
$msg->send;
The "Path" attribute is the full path to the file you are sending.
The "Filename" attribute is the filename that will be displayed to the person who receives the email.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.