이전에 묻는 질문이 있지만 콘솔에 있다고해도 계속 작동하지는 않습니다.내 ROR4 응용 프로그램에서 전자 메일 보내기
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'example.com',
user_name: '[email protected]',
password: 'mypassword',
authentication: 'plain',
enable_starttls_auto: true }
테스트 (설정에서)
emailer.rb
class Emailer < ActionMailer::Base
default from: "[email protected]"
def welcome_email()
@url = 'http://example.com/login'
email_with_name = "#{My Name} <#{[email protected]}>"
mail(to: email_with_name, subject: 'Test')
end
end
으로 environment.rb 번호, 나는 내가 만약 있다고 말했다있어
콘솔에 Emailer.welcome_email().deliver
를 걸었습니다 제 설정이 잘못되었으므로 오류가 나타나지 않을 수도 있습니다.
이 설정을 모든 사용자에게 표시합니까? 그렇다면 문제를 찾기 위해 어디에서 확인할 수 있습니까?
감사합니다.
'log/development.log'에서 무엇을 보았습니까? 이 블로그 게시물은 도움이 될 것입니다. http://nofail.de/2013/10/debugging-rails-applications-in-development/ – phoet