Skip to content

Commit c0bf22d

Browse files
committed
Enable sending emails with SMTP
1 parent a9d3506 commit c0bf22d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

config/environments/production.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,21 @@
7575
# config.action_mailer.raise_delivery_errors = false
7676

7777
# Mail delivery method
78-
config.action_mailer.delivery_method = :sendmail
78+
if ENV['USE_SMTP']
79+
config.action_mailer.delivery_method = :smtp
80+
config.action_mailer.smtp_settings = {
81+
address: ENV['SMTP_ADDRESS'],
82+
port: ENV['SMTP_PORT'],
83+
domain: ENV['SMTP_DOMAIN'],
84+
user_name: ENV['SMTP_USERNAME'],
85+
password: ENV['SMTP_PASSWORD'],
86+
authentication: ENV['SMTP_AUTHENTICATION'],
87+
enable_starttls_auto: true
88+
}
89+
else
90+
config.action_mailer.delivery_method = :sendmail
91+
end
92+
7993

8094
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
8195
# the I18n.default_locale when a translation cannot be found).

0 commit comments

Comments
 (0)