Install PHPMailer from Source Code

This section provides a tutorial example on how to install PHPMailer from source code on any system without any installation tools.

If you are not able to install PHPMailer with any installation tool on any system, you can try to install it from source code as what I did below:

1. Go to PHPMailer GitHub site at

2. Click "Code > Download ZIP" to get the source code as

3. Unzip the downloaded file. You will see the "PHPMailer-master" sub-directory.

4. Move and rename the "PHPMailer-master/src" sub-directory to a shared installation directory like:

linux$ sudo mv PHPMailer-master/src /usr/share/PHPMailer

mac$ sudo mv PHPMailer-master/src /Users/Shared/PHPMailer

windows> xcopy PHPMailer-master/src C:\Users\public\PHPMailer

5. Update the test program, PHPMailer-Test.php, with the installation directory and run it. I see no errors.

6. If you are using PHP 5.6, you need to download source code of the PHPMailer 5.2 branch by going to the branches page at

Table of Contents

 About This Book

 Introduction to Email

 Postfix - Mail Transport Agent (MTA)

 SSL/TLS Secure Connections with Postfix Server

 Dovecot - IMAP and POP3 Server

 SSL/TLS Secure Connections with Dovecot Server

 Email Client Tools - Mail User Agents (MUA)

 Mozilla Thunderbird - Mail User Agents (MUA)

PHPMailer - PHP Package for Sending Emails

 Install PHPMailer on CentOS Systems

 Send Local Emails with PHPMailer

 Send Remote Emails with PHPMailer

 Use SMTPS Protocol with PHPMailer

 PHP 5.6 and PHPMailer 5.2

Install PHPMailer from Source Code

 Send Email Attachments with PHPMailer

 Send Email in HTML with PHPMailer

 Email Message Format and Headers


 Full Version in PDF/EPUB