Sending emails from a Drupal site is essential for user notifications, contact forms, and password resets. By default, Drupal uses PHP's mail() function, which is unreliable and can result in emails being marked as spam. The recommended solution is to configure sending via an SMTP server, specifically with a professional OVH email account.
In this article, we will see how to configure Drupal to use an OVH email account in SMTP, using the SMTP module.
1 Install modules
The SMTP Authentication Support module is essential for managing email sending via SMTP.
composer require drupal/smtp
The mime mail module is also important because it allows you to send emails in HTML format.
composer require drupal/mimemail
Then start the installation.
drush smtp mimemail
3 Module configuration
The SMTP module configuration [ /admin/config/system/smtp ] is as follows:
- SMTP server : ssl0.ovh.net
- SMTP port : 587
- Use encrypted protocol: Use TLS
- Enable TLS encryption automatically: Yes
- Timeout: 30

Next, you need to add the email account.

The Mail system module configuration [ /admin/config/system/mailsystem ] is as follows:
- Formatting tool: Mime mail Mailer
- Sender: SMTP Mailer
- Theme to render the emails: Current

The configuration of the Mime Mail module [ /admin/config/system/mimemail ] is as follows:
Email format: Full HTML
