http://qs321.pair.com?node_id=184777


in reply to Re: Can I clean this up??
in thread Can I clean this up??

Note that you should probably be using something like Mail::Mailer or Mail::SendMail to do the dirty work of sending mail.
I can think of reasons why in some cases you might prefer Mail::Mailer over using mailx, but "the dirty work" isn't one of them. When I use Mail::Mailer, I need three lines of code on overhead. One line for the OO overhead, a second line to actually open a mail, and a third line to close the mail.

When using mailx, I only need 2 lines: one for the open, a second for the close. There's no "dirty work" here - the dirty work is done by mailx!

I've never had problems using mailx, something I cannot say from Mail::Mailer (or Mail::Send).

Abigail