Net::SMTPAuthenticationError

Hey guys,
I want to send an email via ROR and I have put this code at the very end
in the config/environment.rb file-

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.logger = nil
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.smtp_settings = {
:address => “[my smtp server]”,
:port => 25,
:domain => '[my domain],
:authentication => :plain,
:user_name => ‘[email protected]’,
:password => ‘[my password]’
}

but when i click on send mail button, it shows following error:

Net::SMTPAuthenticationError in MailingController#sendmail

502 unimplemented (#5.5.1)

RAILS_ROOT: C:/work/2phone
Application Trace | Framework Trace | Full Trace

c:/ruby/lib/ruby/1.8/net/smtp.rb:577:in auth_plain' c:/ruby/lib/ruby/1.8/net/smtp.rb:571:insend
c:/ruby/lib/ruby/1.8/net/smtp.rb:571:in authenticate' c:/ruby/lib/ruby/1.8/net/smtp.rb:411:indo_start’
c:/ruby/lib/ruby/1.8/net/smtp.rb:378:in start' c:/ruby/lib/ruby/1.8/net/smtp.rb:316:instart’
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:586:in
perform_delivery_smtp' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:469:insend
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:469:in
deliver!' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:352:inmethod_missing’
app/controllers/mailing_controller.rb:8:in `sendmail’

Please help me out from this problem, i have got stuck due to this

Please also tell me the requirements for sending mail, if i am missing
something. any gems, settings or …

On Fri, Apr 11, 2008 at 5:28 PM, Shikha S.
[email protected] wrote:

Net::SMTPAuthenticationError in MailingController#sendmail
502 unimplemented (#5.5.1)

RAILS_ROOT: C:/work/2phone
Application Trace | Framework Trace | Full Trace
c:/ruby/lib/ruby/1.8/net/smtp.rb:577:in `auth_plain’

This is probably saying that the SMTP server you are trying to send
through doesn’t support plain authentication.

Find out what types of authentication your SMTP server supports, this
will help.

Mikel

What Authentication type should be there for sending an email?

When I changed the type of :authentication in config/environment.rb file, :plain to :cram_md5 now it showed me this error:

Net::SMTPSyntaxError in MailingController#sendmail

502 unimplemented (#5.5.1)

RAILS_ROOT: C:/work/2phone
Application Trace | Framework Trace | Full Trace

c:/ruby/lib/ruby/1.8/net/smtp.rb:680:in check_response' c:/ruby/lib/ruby/1.8/net/smtp.rb:593:inauth_cram_md5’
c:/ruby/lib/ruby/1.8/net/smtp.rb:686:in critical' c:/ruby/lib/ruby/1.8/net/smtp.rb:592:inauth_cram_md5’
c:/ruby/lib/ruby/1.8/net/smtp.rb:571:in __send__' c:/ruby/lib/ruby/1.8/net/smtp.rb:571:inauthenticate’

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Shikha S. wrote:

|
| What Authentication type should be there for sending an email?

http://www.ietf.org/rfc/rfc2821.txt


Phillip G.
Twitter: twitter.com/cynicalryan

~ “It’s hard to be mad at someone who misses you while you’re asleep.”

  • -Calvin
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.8 (MingW32)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkf/HsMACgkQbtAgaoJTgL8nNQCeK3KjpzlMFOkDfA+J0A3ltyAl
BCgAmwSsW1b7BdT3yOdyJXAS2SqcQKmK
=yHUW
-----END PGP SIGNATURE-----

Mikel L. wrote:

On Fri, Apr 11, 2008 at 5:28 PM, Shikha S.
[email protected] wrote:

Net::SMTPAuthenticationError in MailingController#sendmail
502 unimplemented (#5.5.1)

RAILS_ROOT: C:/work/2phone
Application Trace | Framework Trace | Full Trace
c:/ruby/lib/ruby/1.8/net/smtp.rb:577:in `auth_plain’

This is probably saying that the SMTP server you are trying to send
through doesn’t support plain authentication.

Find out what types of authentication your SMTP server supports, this
will help.

Mikel

What Authentication type should be there for sending an email?

Thanks

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Shikha S. wrote:
|> What Authentication type should be there for sending an email?
|>
|>
|> When I changed the type of :authentication in config/environment.rb
file, :plain to :cram_md5 now it showed me this error:
|
|
| Net::SMTPSyntaxError in MailingController#sendmail

Have you actually tried to RTFM of your mail server, and know how it is
configured?


Phillip G.
Twitter: twitter.com/cynicalryan

YUMMIE–Young Upwardly Mobile Mutant
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkf/H3cACgkQbtAgaoJTgL8qUgCfbvpLplx7VKUUNE7g89rS2Els
vEsAnjT+xw9+mo6iBBKfgcQPOD2vJwHV
=XECd
-----END PGP SIGNATURE-----

On Fri, Apr 11, 2008 at 6:00 PM, Shikha S.
[email protected] wrote:

What Authentication type should be there for sending an email?

Usually none.

Most SMTP servers don’t authenticate beyond sender domain, source
address and recipient domain.

So try none and see how you go.

Mikel
http://lindsaar.net/

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
}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs