How To Install php-PHPMailer on CentOS 7

In this tutorial we learn how to install php-PHPMailer on CentOS 7. php-PHPMailer is PHP email transport class with a lot of features

Introduction

In this tutorial we learn how to install php-PHPMailer on CentOS 7.

What is php-PHPMailer

Full Featured Email Transfer Class for PHP. PHPMailer features * Supports emails digitally signed with S/MIME encryption! * Supports emails with multiple TOs, CCs, BCCs and REPLY-TOs * Works on any platform. * Supports Text & HTML emails. * Embedded image support. * Multipart/alternative emails for mail clients that do not read HTML email. * Flexible debugging. * Custom mail headers. * Redundant SMTP servers. * Support for 8bit, base64, binary, and quoted-printable encoding. * Word wrap. * Multiple fs, string, and binary attachments (those from database, string, etc). * SMTP authentication. * Tested on multiple SMTP servers Gmail, Imail, Exchange, etc. * Good documentation, many examples included in download. * It’s swift, small, and simple.

We can use yum or dnf to install php-PHPMailer on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install php-PHPMailer.

Install php-PHPMailer on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install php-PHPMailer using yum by running the following command:

sudo yum -y install php-PHPMailer

Install php-PHPMailer on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install php-PHPMailer using dnf by running the following command:

sudo dnf -y install php-PHPMailer

How To Uninstall php-PHPMailer on CentOS 7

To uninstall only the php-PHPMailer package we can use the following command:

sudo dnf remove php-PHPMailer

References

Summary

In this tutorial we learn how to install php-PHPMailer on CentOS 7 using yum and dnf.