Chapter 16. Email Connectivity

Electronic mail is arguably the most essential Internet application. In fact, for many people, it’s their introduction to the Internet. Thus, the Perl modules that deal with email are among the most useful modules. There are two major groups of modules that provide email capabilities. The first group is Graham Barr’s libnet collection, which contains packages for developing client-side applications over the Internet in Perl. Table 16-1 lists some of the protocols implemented by the libnet modules.

Table 16-1. Protocols implemented by the libnet modules

Protocol

Module

Description

POP3

Net::POP3

Post Office Protocol, for reading email

SMTP

Net::SMTP

Simple Mail Transfer Protocol, for sending email

FTP

Net::FTP

File Transfer Protocol, for transferring files between hosts

NNTP

Net::NNTP

Network News Transfer Protocol, for reading Usenet news

In this chapter, we discuss Net::SMTP and Net::POP3. Chapter 17 talks about Net::NNTP, Chapter 18 discusses Net::FTP, and Chapter 19 covers Net::LDAP. Other libnet modules, such as Net::SNPP and Net::Time, are not described in this book, but you can get information about them from CPAN or with the perldoc command if libnet is installed on your system.

The second group of mail-related modules are the Mail modules, which can be found on CPAN as the MailTools collection. Other interesting mail-related modules include Mail::Folder and its subclasses, Mail::RBL, Mail::Audit, and Unix::AliasFile. This chapter describes the following ...

Get Perl in a Nutshell, 2nd 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.