Emails don't obey module settings (even though 'Test email' works) without configuring default system.mail interface

Created on 1 October 2018, over 6 years ago
Updated 19 May 2023, over 1 year ago

Symptom: 'Send test email' works, but your SMTP settings aren't being used - mails go via the default PHP mail handler, not your 3rd-party transactional mail service etc.

Fix: add this to settings.php:

$config['system.mail']['interface']['default'] = 'SMTPMailSystem';

What we should do: improve documentation.

--
Original issue summary:

Hi,

I tried to enforce the usde of the SMTP Authentication module with these settings in the settings.php file :

$config['smtp.settings']['smtp_on']         = true;
$config['smtp.settings']['smtp_host']       = 'mx1.example.com';
$config['smtp.settings']['smtp_hostbackup'] = '';
$config['smtp.settings']['smtp_username']   = 'smtp_ex@example.com';
$config['smtp.settings']['smtp_password']   = 'example_password';
$config['smtp.settings']['smtp_from']       = 'smtp_ex@example.com';
$config['smtp.settings']['smtp_fromname']   = '';
$config['smtp.settings']['smtp_port']       = '25';
$config['smtp.settings']['smtp_protocol']   = 'tls';
$config['smtp.settings']['smtp_allowhtml']  = '1';

It didn't worked at first. I used the "Send test e-mail" field to validate if config were read properly, and yes, they are.

I decided to comment out the first line in my config, making the "ON/OFF" field available again in the UI. I turned of the SMTP module there, tested the emails with Webform again and it started working.

I'll be honest, I don't know enough about the configuration management of Drupal to figure this one out... But as far as I understand, it should work...

Feature request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇨🇦Canada arakwar

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024