Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Mail modules on W2K

by beebware (Pilgrim)
on Feb 07, 2002 at 20:57 UTC ( [id://143969]=note: print w/replies, xml ) Need Help??


in reply to Mail modules on W2K

For sending mail from multi-platforms (such as using a Windows 2000 Professional machine for testing, moving the code to Windows 2000 Advanced Server and then to a Linux box), I tend to use Mime::Lite. It's available via Activestate PPM (so it's extremely easy to install on a Windows machine), you can configure it to either Sendmail (if you've got it installed) or connect directly to your mail server, you can add 'attachments' and it's got plenty of example code for you to examine and try - one of the simplist ways that I use it is:

use Mime::Lite MIME::Lite->send('smtp', $mail_server_name_or_ip_address, TimeOut=>60) +; my $msg=MIME::Lite->new ( From=>"$from_name <$from_email_address>", To =>"$to_email_address", Subject=>"$subject_of_email", Type=>'text', Data=>$body_of_email ); $msg->send;

There is also Mail::Sender and Net::SMTP for you to consider. An example of Net::SMTP code is:

use Net::SMTP my $smtp=Net::SMTP->new($mailserver_name_or_ip_address); $smtp->mail($from_address); $smtp->to($to_address); $smtp->data(); $smtp->datasend("To: $to_address\n"); $smtp->datasend("From: $from_address\n"); $smtp->datasend("Subject: $message_subject\n"); $smtp->datasend("\n$body_of_email\n"); $smtp->dataend(); $smtp->quit;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://143969]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2025-02-07 02:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (94 votes). Check out past polls.