2015-05-12 2 views
0

enter image description here Я использую устройство, но подтверждаю и забываю пароль. Почта не отправляется. Я применяю этот кодпочта не отправляется устройством rails 4

devise.rb 
config.mailer = 'Devise::Mailer' 

developement.rb 
config.action_mailer.default_url_options = { :host => "localhost:3000" } 
config.action_mailer.delivery_method = :smtp 
config.action_mailer.perform_deliveries = true 
config.action_mailer.smtp_settings = { 
     :address  ![enter image description here][2]   => 'smtp.gmail.com', 
     :port     => 458, 
     :domain    => 'gmail.com', 
     :user_name   => '[email protected]', 
     :password    => '123456', 
     :authentication  => 'plain', 
     :enable_starttls_auto => true 
} 

Smtp работает в других проектах. Пожалуйста, предложите мне, где я неправильно

+1

Пожалуйста, добавьте 'config.action_mailer.raise_delivery_errors = true' развития. rb и опубликовать сообщение об ошибке –

+0

Вы превысили лимит ежедневной отправки gmail? –

+0

@RajarshiDas Das после этого я получил эту ошибку = SocketError в Devise :: PasswordsController # create, getaddrinfo: Имя или услуга неизвестна, – Harman

ответ

0

необходимо обновить порт: 458 в: порт => 587

0

Он должен работать нормально

config.action_mailer.default_url_options = { :host => "localhost:3000" } 
config.action_mailer.delivery_method = :smtp 
config.action_mailer.perform_deliveries = true 
config.action_mailer.raise_delivery_errors = true 
config.action_mailer.smtp_settings = { 
     :address    => 'smtp.gmail.com', 
     :port     => 587, 
     :domain    => 'gmail.com', 
     :user_name   => '[email protected]', 
     :password    => '123456', 
     :authentication  => 'plain', 
     :enable_starttls_auto => true 
} 
Смежные вопросы