Hi there guys!
Im copying an email example from “Agile web development with rails”, but
i keep getting a “501: sender address must contain a domain” error.
Heres my code in my enviroment.rb. Real values replaced with
“something”:
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_charset ="utf-8"
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.server_settings = {
:address => "something.something.net",
:port => 25,
:domain => "something.com",
:user_name => "[email protected]",
:password => "something",
:authentication => :login
}
And heres my method:
def confirm(customer)
@subject = 'Sign up verification'
@body["customer"] = customer
@recipients = customer.email
@from = 'SilverSky'
@sent_on = Time.now
end
def send_mail
customer = Customer.find_by_firstname("erkan1")
email = CustomerMailer.create_confirm(customer)
email.set_content_type("text/html")
if CustomerMailer.deliver(email)
render(:text => "Thank you" )
end
Any help would be greatly appreciated! This is getting me down!