A Mailing Function
The objective of the following sections is for you to write a short Perl function that you can use in your CGI programs to send mail. There is a problem, though. The way the function works is fairly dependent on whether you have a local MTA (such as sendmail) or whether you have to send the mail yourself to an SMTP relay host. So scan ahead, and decide which of the following sections you're going to need for your particular program.
A Mail Function for UNIX Systems
If you have a UNIX system, and sendmail is properly configured (it probably will be), you're reading the right section. If you don't have UNIX or sendmail, and you're reading this section out of curiosity—good for you. However, the function presented in Listing 22.1 ...
Get Sams Teach Yourself Perl in 24 Hours now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.