Module Description
Send emails via SMTP using the latest PHPMailer library.

The only requirements are the Mail System module and an SMTP service.

Why? See this discussion for an overview and a list of alternatives.

Features
* Send email via SMTP using an external service
* Supports HTML emails, attachments and inline images
* RFC compliant ensuring robust email delivery
* Doesn't reinvent the wheel - uses the PHPMailer library wherever possible
* Debugging options
* Advanced SMTP settings

Requirements
* Access to an SMTP server
* The Mail System module.
* PHPMailer 6 library - installed via composer, see below

Installation composer require drupal/phpmailer_smtp

This installs the module and the PHPMailer library. Enable the module as usual.

If you can't use composer Ludwig is supported.

Configuration Configure PHPMailer SMTP
SMTP server configuration

Administer -> Configuration -> System -> PHPMailer SMTP

Email format

Administer -> Configuration -> System -> PHPMailer SMTP -> Format

Selecting "Plain text" will force all emails to be plain text.

Install and Configure Mail System
composer require drupal/mailsystem

Enable the mail system module then configure:

Administer -> Configuration -> System -> Mail System.

Select "PHPMailer SMTP" as "Sender" under "Default Mail System" and "Module-Specific Configuration" as required.

Select "PHPMailer SMTP" as the Formatter

OAuth2 OAuth2 is supported via basic plugins. For an example using Azure, see PHPMailer OAuth2. Review the code in the module to find out how it works so you can implement your own provider.

The PHPMailer library supports league/oauth2-client providers:


* Official provider clients
* Third-party provider clients

As of PHPMailer 6.6.0, the library now accepts anything that implements the OAuthProviderInterface. This includes Google's OAuth classes.

Optional Performance

To improve performance on page load emails can be queued prior to sending.


* Queue Mail will queue emails which can then be sent later on a cron run.
* Ultimate Cron allows for fine-grained control over cron runs. For example using Queue Mail, email can be stored and sent sent every minute while other tasks are performed once an hour.

Security

For better security, SMTP credentials can be stored outside normal config.


* Key can override any configuration value with a key to store configuration values more securely. See Overriding configuration
* Encrypt adds encryption support with a patch for the Key module: #2980072: Encrypt key value

Project Usage
6992
Creation Date
Changed Date
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
This module aims to solve the problem of sending emails via SMTP using the latest PHPMailer library, with features such as support for HTML emails, attachments, and inline images, as well as advanced SMTP settings and debugging options.
Data Name
phpmailer_smtp

OPENAI CHATBOT

OPENAI CHATBOT

00:09:31
Generic Chatbot
Hi, I'm a Drupal module expert powered by OpenAI, answering your questions about the Drupal module ecosystem. How can I be helpful today? Please note that we will log your question.