How Email Works

Before I explain how to send email from within a CGI script, let me first explain how Internet email works at a very high level. First, email messages are usually generated using a mail client. Popular mail clients include Outlook Express, Eudora, and Mutt. However, a mail client is really any program from which an email message originates. In this hour, the email client is the CGI program that sends the email message.

Internet email delivery is facilitated by software called a mail transfer agent. A mail transfer agent, or MTA, is different than mail clients, like Eudora or Microsoft Outlook. A mail transfer agent’s job is to examine email messages, determine what the next step toward delivering them is, and then performing ...

Get Sams Teach Yourself CGI in 24 Hours, Second Edition 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.