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

Re: sending e-mail using perl script

by Steve_BZ (Chaplain)
on Aug 12, 2012 at 19:04 UTC ( [id://986973]=note: print w/replies, xml ) Need Help??


in reply to sending e-mail using perl script

Hi Artifact,

I use Mail::Sender from my code. Here's a test script to use it:

#!/usr/bin/perl -w use strict; use Mail::Sender; my $sender = new Mail::Sender { auth => 'PLAIN', authid => 'your email userid', authpwd => 'your email userid password', smtp => 'your isp smtp server', port => 587, from => 'image@i-mageonline.com', to => 'you@yourdomain.com', subject => 'This is a test.', msg => 'Test Message Script', #file => '/home/image/Documents/Endoscopia/default.pdf', #debug => "/home/image/Documents/SendMailDebug.txt", #debug_level => 4, #timeout => 500, }; #my $result = $sender->MailFile({ my $result = $sender->MailMsg({ msg => $sender->{msg}, #file => $sender->{file}, }); print "$sender->{error_msg}\n>>>End.\n"; 1;

You can customise the script.

Have fun.

It's well-functioned and intuitive.

Regards

Steve

Replies are listed 'Best First'.
Re^2: sending e-mail using perl script
by artifact (Novice) on Aug 13, 2012 at 07:42 UTC

    thanks everybody for the help. I found the Mail::Sender an easy one for a novice like me. I'll check other modules as well . I feel good having some wisdom !!!

Re^2: sending e-mail using perl script
by ytjPerl (Scribe) on Sep 30, 2019 at 15:57 UTC
    Hi How to pass parameter to the email subroutine, I need the value of parameter to be shown on the email subject and body. Thanks in advance

      What "email subroutine" are you talking about?

      Nowhere in this thread was such a subroutine posted, so maybe you wanted to reply to a different thread?

      If the "email subroutine" is in some code that you are not showing us, consider posting the relevant parts of the code. Also tell us how the code fails to do what you need, and also show us what you already tried and also how that failed for you.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-20 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found