Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

How to send mails from a Windows system

by santhanamv (Initiate)
on Jul 18, 2006 at 05:52 UTC ( [id://561928]=perlquestion: print w/replies, xml ) Need Help??

santhanamv has asked for the wisdom of the Perl Monks concerning the following question:

HI Monks,

Greetings.!!!!

My requirement is to process a file and send the report through mail. I have used some mail sending options in UNIX box. Since I am new to Windows, could anyone help me how to send mails from Windows system. If possible, give some example code.

Thanks in advance

-Santh-

2006-07-18 Retitled by Arunbear
Original title: 'Reg: Sening mails in Windows'

  • Comment on How to send mails from a Windows system

Replies are listed 'Best First'.
Re: How to send mails from a Windows system
by jfluhmann (Scribe) on Jul 18, 2006 at 06:43 UTC
    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

Re: How to send mails from a Windows system
by NetWallah (Canon) on Jul 18, 2006 at 06:02 UTC
    One of the most effective tools I use for Windows SMTP Mail is called sndmail2, which you can get from Davide Libenzi's home page. It is well documented.

    To develop a perl based solution, use Net::SMTP.

         "For every complex problem, there is a simple answer ... and it is wrong." --H.L. Mencken

Re: How to send mails from a Windows system
by santhanamv (Initiate) on Jul 18, 2006 at 07:04 UTC
    Thanks for your great effort
    I will try this and let you know.

    Regards,
    Santh
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 03:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found