Email Net::SMTPFatalError when sending email from Rails App
Posted
by Danny McClelland
on Stack Overflow
See other posts from Stack Overflow
or by Danny McClelland
Published on 2010-04-28T17:45:04Z
Indexed on
2010/04/28
17:47 UTC
Read the original article
Hit count: 982
Hi Everyone,
I have setup my application to send an email when a new case is created.
if @kase.save
UserMailer.deliver_contact_confirmation(@user)
I have added the following to my user_mailer.rb
def contact_confirmation(user)
@subject = 'Message Subject'
@body = "Message content"
@from = "[email protected]"
end
but...when I create a new case and click submit I get the following:
Net::SMTPFatalError in KasesController#create
555 5.5.2 Syntax error. x1sm110877wbx.1
I have added the SMTP details to the environment.rb as follows:
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
:port => "587",
:domain => "XXXX.co.uk",
:authentication => :plain,
:user_name => "[email protected]",
:password => "XXXX"
}
Any ideas?
Thanks,
Danny
© Stack Overflow or respective owner