As I was complating 6 months in the Monastery I took a look back at some very old code I wrote about 20 years ago. It is clear that things have come a long way since then :)
But, in that code was a pipe straight into sendmail. These days, and for quite a few years, if I want to send an email I either use MIME::Lite or a module I created some years ago (my first module I think) which is a wrapper around Net::SMTP.
open(MAIL,"|$send_path -t"); # send email headers print MAIL ("To: $send_addr\n"); print MAIL ("From: $from_addr\n"); print MAIL ("Subject: Lane Entry Form submitted\n\n"); # send email body print MAIL ("----- Notification of new Lane Data -----\n\n"); close(MAIL);
I'm not sure why I put the brackets in!
But it got me thinking that piping to sendmail is quite simple. The code is clear and, presumably, it is quite an efficient way to send an email.
Other than it not being portable away from an *nix environment, is there any reason not to do this?
In reply to Piping to sendmail by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |