RedHat does not install mailx by default
So, you use mail, or whatever RedHat installs by default.
I would only use Mail::Mailer for portability reasons,
but that wasn't a reason that was mentioned.
And don't forget, system() calls aren't exactly free either.
Your point being? Have you ever looked into the works of Mail::Mailer?
For Unix like systems, the _default_ is to use an external mail program
like mail or mailx. And guess how that's
invoked? By doing a fork & exec, just like you would be doing with:
open my $fh => "| mailx args" or die;
which my preferred way of calling mailx.
If you need to send mail, you better be using SMTP.
Sure, you can use 'mail', but how can you tell if the system actually
checks the mail queue. Is the mail daemon even running? Can you
even assume it's going to be Sendmail? If you have your own little
kingdom where certain things can be taken for granted, you can code
accordingly. In general terms, though, such assumptions are risky.
Mail::Mailer isn't going to use smtp by default
on a Unix system either. If it finds an executable mail or
mailx, it will use that, regardless whether there's a mail
daemon running or not.
As for using SMTP, I think you don't realize what you are saying. That
also means you have to queue, do DNS lookups, and retry (typical up to 5
days) if there's a non-permanent failure in the delivery. Most scripts
want to be finished long before email gets delivered.
Abigail
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|