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'] = 'user@gmail.com';
$settings['smtp_multiple_config']['email_key']['smtp_password'] = 'pass';
$settings['smtp_multiple_config']['email_key']['smtp_from'] = 'user@gmail.com';
$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'] = 'user@gmail.com';
$config['smtp_password'] = 'pass';
$config['smtp_from'] = 'user@gmail.com';
$config['smtp_fromname'] = 'Me';
}
}
Supporting organizations:
Responsible for creation and maintainership of the project.
Project information
Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Integrations
- Ecosystem: SMTP Authentication Support
54 sites report using this module
- Created by gbyte on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
