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

Sedmail or SMTP? (was: Younger Malaclypse)

by Anonymous Monk
on Mar 12, 2002 at 16:35 UTC ( [id://151147]=perlquestion: print w/replies, xml ) Need Help??

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

Quick one, from a newbie experiencing quite a bit of confusion.

Red hat 7.2 / Perl 5 -- I am trying to create a script that will use Sendmail or SMTP to send me an email...

Which is more appropriate of a module to use? Sendmail or SMTP, has nay one had any experience with this.

Thanks

edited 2002-03-14 by mirod: title changed, <p> tags added

  • Comment on Sedmail or SMTP? (was: Younger Malaclypse)

Replies are listed 'Best First'.
Re: Younger Malaclypse
by derby (Abbot) on Mar 12, 2002 at 17:26 UTC
    AM,

    Check out Mail::Mailer. It gives you the flexibility to send mail numerous ways.

    -derby

Re: Younger Malaclypse
by Sinister (Friar) on Mar 12, 2002 at 16:59 UTC
    For simple mailing do something like:
    my $mailer = "/path/to/mailer"; open(MAIL, " | $mailer") || die ("Can't open PIPE to mailer: $mailer ( +$!)\n"); print MAIL <<'EOF'; To: you@yourdomain.com From: "The Camel" <your_perl_script@domain.com> Subject: This is your camel speaking! This is a mailbody, spoken by your camel, wearing a red-hat, being friends with penguin, called Tux EOF close(MAIL);

    For maintainability you might want to decide to place the 'heredoc' (<<'EOF' ... EOF) outside of your code.

    If you are about to do really great things with these emails, (such as adding attachments, etc.) you might want to read in to the use of the modules available on CPAN.

    This code is untested, yet believed functional

    er formait hyarya.
    "Field experience is something you don't get until just after you need it."
Re: Younger Malaclypse
by maverick (Curate) on Mar 12, 2002 at 18:46 UTC
    I've used Mail::Sendmail and Mail::Bulkmail pretty extensively. Mail::Sendmail is pretty nice in that you don't have to have a local mail server to use it, some of the other Mail:: packages do. If you're going to produce a mailing list (update notification for a website, or something of the sort) then Mail::Bulkmail would be the way to go.

    HTH

    /\/\averick
    perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2024-04-16 16:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found