From 28d4f3a473a50faeb1885fc34ff8c0dc25e317f9 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Fri, 28 Nov 2008 23:22:33 -0500 Subject: [PATCH] Added an additional option to smtp_settings to specify whether SSL is used for the connection --- actionmailer/lib/action_mailer/base.rb | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index acb9aff..e343ee2 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -212,7 +212,7 @@ module ActionMailer #:nodoc: # * :password - If your mail server requires authentication, set the password in this setting. # * :authentication - If your mail server requires authentication, you need to specify the authentication type here. # This is a symbol and one of :plain, :login, :cram_md5. - # + # * :ssl - If the connection to your mail server will use SSL. Defaults to true # * sendmail_settings - Allows you to override options for the :sendmail delivery method. # * :location - The location of the sendmail executable. Defaults to /usr/sbin/sendmail. # * :arguments - The command line arguments. Defaults to -i -t. @@ -256,7 +256,8 @@ module ActionMailer #:nodoc: :domain => 'localhost.localdomain', :user_name => nil, :password => nil, - :authentication => nil + :authentication => nil, + :ssl => true } cattr_accessor :smtp_settings @@ -672,7 +673,7 @@ module ActionMailer #:nodoc: sender = mail['return-path'] || mail.from smtp = Net::SMTP.new(smtp_settings[:address], smtp_settings[:port]) - smtp.enable_starttls_auto if smtp.respond_to?(:enable_starttls_auto) + smtp.enable_starttls_auto if smtp.respond_to?(:enable_starttls_auto) unless smtp_settings[:ssl] == false smtp.start(smtp_settings[:domain], smtp_settings[:user_name], smtp_settings[:password], smtp_settings[:authentication]) do |smtp| smtp.sendmail(mail.encoded, sender, destinations) -- 1.6.0