views:

43

answers:

1

Hi, i'm trying to send confirmation email to the user.

But i get following error:

Net::SMTPAuthenticationError (502 5.5.2 Error: command not recognized

Configuration in production.rb is following:

# Disable delivery errors, bad email addresses will be ignored
config.action_mailer.raise_delivery_errors = true

# set delivery method to :smtp, :sendmail or :test
config.action_mailer.delivery_method = :smtp

# these options are only needed if you choose smtp delivery
config.action_mailer.smtp_settings = {
  :address        => 'path_to_address_specified_by_my_hoster',
  :port           => 25,
  :domain         => 'my_domain.com',
  :authentication => :plain,
  :user_name      => 'signup@my_domain.com',
  :password       => 'password'
}

I have created a mailbox in user profile at my hosting provider, named "signup@my_domain.com"

For created mailbox, they issued to me login and password:

login = verbose_login

password = verbose_password

I did't completely understood the exact format of :user_name.

Should i use

:user_name => "signup@my_domain.com"

or:

:user_name => "signup"

or:

:user_name => "verbose_login"

Or this field is specific to the mail server, and i must ask support of hosting provider ?

And what the difference between :authentication => :plain and :login ?

Thanks.

A: 

This works well for me:

config.action_mailer.smtp_settings = {
    :address              => 'smtp.gmail.com',
    :port                 => 587,
    :domain               => 'gmail.com',
    :user_name            => '[email protected]',
    :password             => 'secret_password',
    :authentication       => 'login',
    :enable_starttls_auto => true
  }

more info here

Petr

praethorian