0

邮件/开发.rb

config.action_mailer.delivery_method = :smtp  
config.action_mailer.smtp_settings = {
 :adress => 'myemail@gmail.com',
 :port => 25,
 :authentication => :login,
 :user_name => 'myemail',
 :password => 'secret'
}   

这是我的邮件:

class UserMailer < ActionMailer::Base
def welcome_email(name, email, subject, question)
@recipients   = email
@from         = "myemail@gmail.com"
headers         "Reply-to" => "myemail0@gmail.com"
@subject      = "Welcome to MyDomain"
@sent_on      = Time.now
@content_type = "text/html"
#body[:username]  = name
mail(:to => email, :subject => subject, :from => 'myemail@gmail.com')
end
end

有这个错误:504 5.3.3 AUTH mechanism LOGIN not available

请帮助,在此先感谢。

4

1 回答 1

1

我使用这些方面的东西来与 gmail 交谈

config.action_mailer.delivery_method = :smtp  
config.action_mailer.perform_deliveries = true

config.action_mailer.smtp_settings = {
 :address => 'smtp.gmail.com',
 :port => 587,
 :authentication => 'plain',
 :user_name => 'myemail',
 :password => 'secret',
 :enable_starttls_auto => true,
 :domain => 'gmail.com'
}   
于 2013-04-24T11:00:11.940 回答