Fixed issue #648 - Sending emails via SMTPS (Port 465 and SSL) not possible.
This commit is contained in:
parent
9a8327c51a
commit
24d8b79503
1 changed files with 10 additions and 1 deletions
|
@ -30,7 +30,11 @@ class Channel::Driver::Smtp
|
|||
if !options.key?(:port) || options[:port].empty?
|
||||
options[:port] = 25
|
||||
end
|
||||
|
||||
if !options.key?(:ssl)
|
||||
if options[:port].to_i == 465
|
||||
options[:ssl] = true
|
||||
end
|
||||
end
|
||||
if !options.key?(:domain)
|
||||
# set fqdn, if local fqdn - use domain of sender
|
||||
fqdn = Setting.get('fqdn')
|
||||
|
@ -57,6 +61,11 @@ class Channel::Driver::Smtp
|
|||
enable_starttls_auto: options[:enable_starttls_auto],
|
||||
}
|
||||
|
||||
# set ssl if needed
|
||||
if options[:ssl].present?
|
||||
smtp_params[:ssl] = options[:ssl]
|
||||
end
|
||||
|
||||
# add authentication only if needed
|
||||
if options[:user].present?
|
||||
smtp_params[:user_name] = options[:user]
|
||||
|
|
Loading…
Reference in a new issue