Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How to send mails from a Windows system

by jfluhmann (Scribe)
on Jul 18, 2006 at 06:43 UTC ( [id://561936]=note: print w/replies, xml ) Need Help??


in reply to How to send mails from a Windows system

Santh,

I've always used Mail::Mailer from MailTools. Here's some example code:

use Mail::Mailer; my $body = "This is the message body, line 1\n"; $body .= "This is the message body, line 2\n"; my $mailer = Mail::Mailer->new( 'smtp', Server => 'smtp-server.example.com') or die "Unable to create a new mailer object:$!\n"; $mailer->open({ From => "jfluhmann\@example.com", To => "jeremy\@example.com", Subject => "Test E-mail"}) or die "Unable to populate mailer object:$!\n"; print $mailer $body; $mailer->close;

You should also take a look at Mail::Sender (for attaching files or sending in HTML with a plaintext alternative). I hope that helps!

Jeremy

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-25 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found