0
나는이 레일에서 액션 메일러를 통해 관련 코드를 메일을 보내 구현하려합니다 ..메일 througth 액션 메일러 레일을 보내지
development.rb
config.action_mailer.default_url_options = { host: 'localhost', port: 9292}
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address =>"smtp.gmail.com",
:domain =>"gmail.com",
:port => 587,
:user_name =>"Debasis",
:password =>"************",
:authentication =>"plain",
:enable_starttls_auto =>true
}
내 우편물/user_mailer.rb
class UserMailer < ActionMailer::Base
default :from => "[email protected]"
def registration_confirmation(user)
mail(:to=>user.email, :subject =>"Registered")
end
end
내 이메일이 전송되지 않았습니다 ... 어떻게해야합니까?
는 약 2 요소 인증, 난 그냥 가정을하고 있기 때문에 'raise_delivery_errors'를 사용하여 로그를 확인하는 것이 좋습니다 것 – Debasish
을 설명 할 수있는 일이 오류를 볼 수 있습니다. 특히 그것이 무엇인지 모르는 경우 아마 활성화되지 않을 것입니다. 자세한 내용은 [Google 2 단계 인증] (https://www.google.com/landing/2step/#tab=how-it-works)을 참조하세요. 간단히 말해서 휴대 전화를 계정에 연결하므로 로그인 정보를 확인할 수 있습니다. 또한 당신은 Google 계정을 사용하는 모든 응용 프로그램에 대해 고유 한 암호를 생성해야합니다. –
나는 raise_delivery_errors를 사용했습니다 ...이 오류를 표시합니다 .Net :: SMTPAuthenticationError in UsersController # create 535-5.7.8 Username and Password 허용되지 않음. 자세히 알아보기하지만 비밀번호는 이미 확인 했음 – Debasish