faqts : Computers : Programming : Languages : Perl

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

21 of 28 people (75%) answered Yes
Recently 10 of 10 people (100%) answered Yes

Entry

What's the best way to generate and send mail using Perl and Windows?

Dec 4th, 2002 19:07
Ryan Buterbaugh, Jack Nerad, Jasmine Merced, Stan Wong, http://www.indigostar.com/sendmail.htm


The perl module MIME::Lite is useful for this.
use MIME::Lite;
# windows doesn't have sendmail, so send via smtp
$MIME::Lite->send('smtp','smtp.myisp.net',Timeout => 60);
# make the message
$msg = MIME::Lite->new(To => '[email protected]',
                       From => '[email protected]',
                       Subject=> 'Hello',
                       Type => 'TEXT',
                       Data => 'The message goes here');
# send it
$msg->send();
For more information, see the MIME::Lite module documentation.
http://search.cpan.org/doc/ERYQ/MIME-Lite-2.117/lib/MIME/Lite.pm
Previous answer:
You can also download the demo version of Sendmail for Windows at 
http://www.indigostar.com/sendmail.htm.  The registration fee is 
currently $49.  I prefer Sendmail because after installing Apache, 
Perl 
and Sendmail using the same file structure as my Linux server, the 
program can be uploaded and run without modifying any configuration 
files for the location of these programs.