actionmailer - Rails 4 mailers with gmail smtp -
i want use mailer of rails 4 gmail's smtp configuration in development file set:
config.action_mailer.perform_deliveries = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => "gmail.com", :user_name => "mymail@gmail.com", :password => "mygmailpassword", :authentication => :plain, :enable_starttls_auto => true }
but don't recive mails. output of terminal:
to: antonioni.giovanni9@gmail.com message-id: <55ffb56da9e91_aa929362303435c@pc-rails.mail> subject: conferma ordine mime-version: 1.0 content-type: multipart/alternative; boundary="--==_mimepart_55ffb56da807b_aa92936230342e1"; charset=utf-8 content-transfer-encoding: 7bit ----==_mimepart_55ffb56da807b_aa92936230342e1 content-type: text/plain; charset=utf-8 content-transfer-encoding: quoted-printable
so application try send email not appear on gmail dashboard. idea resolve trouble?
gmail smtp service need app password send mail gmail account (for more info visit link). after generating password must change configuration of development file:
config.action_mailer.perform_deliveries = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => "gmail.com", :user_name => "mymail@gmail.com", :password => "generatedpassword", :authentication => :plain, :enable_starttls_auto => true }
and restart server. catching error i've set: config.action_mailer.raise_delivery_errors = true
(thanks dipak tip)
Comments
Post a Comment