Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/config.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@
# Options: tls, ssl
'smtp.secure' => '',

# SMTP Auto TLS, if an unencrypted SMTP connection should attempt to use STARTTLS
'smtp.autotls' => true,

# Enable SMTP authentication (true/false)
'smtp.auth' => true,

Expand Down
5 changes: 5 additions & 0 deletions docs/source/ADVANCED-CONFIGURATION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ Advanced PHPMailer Settings
'phpmailer' => [
'sendmail.path' => '/usr/sbin/sendmail',
'smtp.debug' => false,
'smtp.autotls' => true,
],

**phpmailer.sendmail.path**
Expand All @@ -167,6 +168,10 @@ Advanced PHPMailer Settings
**phpmailer.smtp.debug**
Enable SMTP debug output (true/false).

**phpmailer.smtp.autotls**
Set PHPMailer's SMTPAutoTLS setting (true/false). Determines if an
unencrypted SMTP connection should attempt to use STARTTLS.

Logging Configuration
---------------------

Expand Down
9 changes: 9 additions & 0 deletions lib/Config/ConfigKeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,15 @@ class ConfigKeys
'section' => 'phpmailer'
];

public const PHPMAILER_SMTP_AUTOTLS = [
'key' => 'phpmailer.smtp.autotls',
'type' => 'boolean',
'default' => true,
'label' => 'SMTP AutoTLS',
'description' => 'If an unencrypted SMTP connection should attempt to use STARTTLS',
'section' => 'phpmailer'
];

public const PHPMAILER_SMTP_AUTH = [
'key' => 'phpmailer.smtp.auth',
'type' => 'boolean',
Expand Down
1 change: 1 addition & 0 deletions lib/Email/EmailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function __construct($phpMailer = null)
$phpMailer->Host = $this->Config(ConfigKeys::PHPMAILER_SMTP_HOST);
$phpMailer->Port = $this->Config(ConfigKeys::PHPMAILER_SMTP_PORT, new IntConverter());
$phpMailer->SMTPSecure = $this->Config(ConfigKeys::PHPMAILER_SMTP_SECURE);
$phpMailer->SMTPAutoTLS = $this->Config(ConfigKeys::PHPMAILER_SMTP_AUTOTLS, new BooleanConverter());
$phpMailer->SMTPAuth = $this->Config(ConfigKeys::PHPMAILER_SMTP_AUTH, new BooleanConverter());
$phpMailer->Username = $this->Config(ConfigKeys::PHPMAILER_SMTP_USERNAME);
$phpMailer->Password = $this->Config(ConfigKeys::PHPMAILER_SMTP_PASSWORD);
Expand Down