22. Email from Perl

It is not uncommon that a CGI script needs to send email. One good reason to send email via a CGI script is to minimize the exposure of email accounts to the web. Once an email address is known to the internet, spams and exploit attempts follow.

Furthermore, when messages are sent via a CGI form, it can be pre-formatted. The subject can be automatically inserted so that email client filters can be used to divert messages one way or another.

This chapter discusses how to send email from a CGI script. Particularly, we are interested in a standalone solution that can send attachments. The reason for ``standalone'' is so that the script can operate without any special email client installed.



Subsections

Copyright © 2008-05-09 by Tak Auyeung