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).
In reply to Re^2: Fast dispatch of e-mails
by tirwhan
in thread Fast dispatch of e-mails
by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |