Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

SMTP Authentication Support (multiple)

Security covered Maintenance fixes only 47 sites

This module allows you to configure different SMTP settings for various email types within your Drupal site. It overrides the default SMTP mail backend to enable per-email key SMTP configurations, providing flexibility in how and where your emails are sent.

This module allows for SMTP configurations on a per email key basis by replacing the implementation of smtp's mail backend plugin. It requires the smtp module.

Use the project's settings.php or settings.local.php to add SMTP configurations
keyed by the email key like so:

$settings['smtp_multiple_config']['email_key']['smtp_host'] = 'smtp.gmail.com';
$settings['smtp_multiple_config']['email_key']['smtp_port'] = '465';
$settings['smtp_multiple_config']['email_key']['smtp_protocol'] = 'ssl';
$settings['smtp_multiple_config']['email_key']['smtp_username'] = '[email protected]';
$settings['smtp_multiple_config']['email_key']['smtp_password'] = 'pass';
$settings['smtp_multiple_config']['email_key']['smtp_from'] = '[email protected]';
$settings['smtp_multiple_config']['email_key']['smtp_fromname'] = 'Me';

Alternatively use the hook_smtp_multiple_config_alter() hook:

function my_module_smtp_multiple_config_alter(array &$config, $key) {

  if ($key === 'comment_notify_comment_notify_mail') {
    $config['smtp_host'] = 'smtp.gmail.com';
    $config['smtp_port'] = '465';
    $config['smtp_protocol'] = 'ssl';
    $config['smtp_username'] = '[email protected]';
    $config['smtp_password'] = 'pass';
    $config['smtp_from'] = '[email protected]';
    $config['smtp_fromname'] = 'Me';
  }
}
Drupal 10–11

Ask your assistant about SMTP Authentication Support (multiple)

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Oct 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Core PHP Release date
2.0.0 Stable 10–11 Oct 23, 2024
2.x-dev Dev 10–11 Oct 23, 2024