Sorry clinton, but this is really bad advice. Using MIME::Lite to run an instance of sendmail (or another MTA aliased to it) for every mail you send is far less efficent than having your app talk to a locally running MTA and send the message normally via SMTP. The overhead of starting up a new process for every message far outweighs the minimal network overhead you incur when talking to a running daemon (especiall, since on sane *NIXes the loopback address is special and hardly involves any network overhead at all).

So my advice would be exactly the opposite, don't pipe the message to a newly started process (which is what MIME::Lite does by default), rather send it via your local mail server installation (which is what Mail::Sendmail does by default).

Also, by inserting your message into a database and picking it up via cron you are in effect creating your own primitive version of a mail server queue. This is extremely unlikely to be as efficient and failsafe as the queueing system of the MTA, since those have been designed and improved expressly for this purpose for a number of years now.

All of this is only true if you can run a local mail server of course (which should be possible for any serious web application).


All dogma is stupid.

In reply to Re^2: Fast dispatch of e-mails by tirwhan
in thread Fast dispatch of e-mails by szabgab

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.