· 8 years ago · Jan 26, 2018, 04:58 AM
1config.yml
2___________________________________
3
4production:
5 mail_delivery_method: "sendmail"
6
7config.defaults.yml
8___________________________________
9
10 mail_delivery_method: sendmail
11 smtp_email_address: "smtp.gmail.com"
12 smtp_email_port: 587
13 smtp_email_user_name: "gvthertest@gmail.com"
14 smtp_email_password: "PASSWORD"
15 smtp_email_domain: "localhost"
16
17production.rb
18___________________________________
19
20mail_delivery_method = (APP_CONFIG.mail_delivery_method.present? ? APP_CONFIG.mail_delivery_method.to_sym : :sendmail)
21
22 config.action_mailer.delivery_method = mail_delivery_method
23
24 if mail_delivery_method == :smtp
25 ActionMailer::Base.smtp_settings = {
26 :address => "smtp.gmail.com",
27 :port => "587",
28 :domain => "gmail.com",
29 :user_name => "gvthertest@gmail.com",
30 :password => "PASSWORD",
31 :authentication => 'plain',
32 :enable_starttls_auto => true
33 }
34 end