Email Net::SMTPFatalError when sending email from Rails App
- by Danny McClelland
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