localhost에서 이메일을 보낼 수 없습니다. 여기 내 코드가있다. 처음에는 메일러 UserMailer를 생성했습니다. enviroment.rb :Ruby On Rails.How 이메일을 보내시겠습니까?
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:adress => '[email protected]',
:port => 25,
:authentication => :login,
:user_name => 'johnoggy3010',
:password => 'secret'
}
우편물/user_mailer :
class UserMailer < ActionMailer::Base
def mail(user)
rexipients '[email protected]'
from '[email protected]'
subject = "Hi"
body :user => user
end
end
내 컨트롤러 : user_mailer에서
UserMailer.deliver_mail(params[:name])
및 템플릿/welcome_email.html.erb :
<h1>Welcome to example.com,<%= user %> </h1>
하지만 omthing 잘못이고 나는 당신의 설정 correct.Here가의 Gmail SMTP를 사용하는 코드입니다 만들 ...
나는 확실히 모르겠다. 이메일을 보낼 때보고있는 것을 게시 할 수 있습니까 (오류 메시지, 잘못된 형식의 이메일, 다른 것)? 덧붙여 말하자면, 'rexipients'는 당신이 '수령인'을 철자하는 방법이 아닙니다 ... – PinnyM
나는 어떤 오류도보고 있지 않습니다 .... –
그래서 당신은 무엇이 잘못됐다고 생각합니까? – PinnyM