Guides and tutorials

Hundreds of tutorials and step by step guides carefully written by our support team.

PHPMailer

INTRODUCTION

In some servers the PHP mail function() is not available. This function is increasingly common that is disabled on servers, as a security measure. Normally it is deactivated by protection against SPAM, mail spoofing and proxy mail server. In case any of the websites hosted is violated by a malicious user, the aforementioned risks are avoided.

PHPMailer's library

The PHPMailer library allows us, among other features, to establish an SMTP connection with a mail server. This SMTP server will be the one who actually sends our email.

The official website of the project on GitHub contains the documentation with the installation and configuration options. Link to Github: https://github.com/PHPMailer/PHPMailer

enter image description here

Create email account and get connection data

We will need to have an email account created and the connection data. For this example we will need: The outgoing mail server (SMTP Server), username and password.

Email account guide

Outlook settings guide

PHPMailer installation with composer

It is the easiest and fastest option for users who already use composer in their project. Add to file composer.json:

"phpmailer/phpmailer": "~6.1"

Or directly: composer require phpmailer/phpmailer

There is a complete configuration example on the Github page.

Manual PHPMailer installation

1.- Download the library of https://github.com/PHPMailer/PHPMailer, click the green button of “Clone or download” and “Download ZIP”

2.- Unzip the downloaded file “PHPMailer-master.zip” and rename the directory PHPMailer-master por PHPMailer

3.- Copy the PHPMailer directory into our project. To verify that the routes are correct, it should exist from the root of our project: /PHPMailer/src/PHPMailer.php

Your privacy is important for us
We use our own cookies for the proper functioning of the site. In addition, third-party cookies are used for analytical purposes only. This information is not associated with any person so that personal identifying data is not stored, but is only information that is collected to identify the session, with the aim of facilitating the analysis of the website. You can change your preferences at any time by entering this website again. For more information about our cookie policy you can visit our Cookies. You can press the "Accept and close" button to give us your consent or you can access more detailed information and manage cookies.
Your privacy is important for us
We use our own cookies for the proper functioning of the site. In addition, third-party cookies are used for analytical purposes only. This information is not associated with any person so that personal identifying data is not stored, but is only information that is collected to identify the session, with the aim of facilitating the analysis of the website. You can change your preferences at any time by entering this website again. For more information about our cookie policy you can visit our Cookies. You can press the "Accept and close" button to give us your consent or you can access more detailed information and manage cookies.