Item Description: Builds MIME structures
Review Synopsis:
I first came across MIME::Lite about 2 years ago when working on an online mail system. We had some in house code that we had been using to create outgoing messages, but it was ugly and brittle.
Output a message:### 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 =>'aaa000123.gif', Filename =>'logo.gif', Disposition => 'attachment' );
Send a message:### Format as a string: $str = $msg->as_string; ### Print to a filehandle (say, a "sendmail" stream): $msg->print(\*SENDMAIL);
MIME::Lite supports several methods to send the message via SMTP.### Send in the "best" way (the default is to use "sendmail"): $msg->send;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: MIME::Lite
by impossiblerobot (Deacon) on Jan 19, 2002 at 21:53 UTC | |
by trs80 (Priest) on Jan 19, 2002 at 23:44 UTC | |
by Jenda (Abbot) on Dec 30, 2002 at 21:38 UTC | |
by petral (Curate) on Jan 21, 2002 at 03:01 UTC | |
Re: MIME::Lite
by gav^ (Curate) on Jan 19, 2002 at 04:41 UTC | |
by trs80 (Priest) on Feb 20, 2002 at 01:44 UTC | |
by gav^ (Curate) on Feb 20, 2002 at 02:35 UTC |