SMTP Authentication Support (multiple)
Security covered
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';
}
}
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.