ActionMailer: Mail isn't delivered


#1

Hi all

I used the search for this, but I got an Application Error, so sorry for
the newbie question.

I have tried to send an e-mail using ActionMailer. I have to following
config (environment.rb):

ActionMailer::Base.server_settings = {
:address => “mail.psyguide.org”,
:port => 25,
:domain => “mail.psyguide.org”,
#:authentication => :login,
#:user_name => “dave”,
#:password => “secret”,
}
ActionMailer::Base.default_charset = “utf-8”

The mail seems to be sent without any problem, and in the log file I
can’t figure out any problem. But the e-mail just doesn’t arrive… How
can I debug this problem?

Thanks for help.
Josh


#2

did you check the logs of your mailserver ?


#3

Adam D. wrote:

did you check the logs of your mailserver ?

Hrm don’t know where I could do that. Wrote an e-mail to the support of
my webspace.
Is there another way to debug? Shouldn’t I have the possibility somehow
to detect within Rails whether the e-mail was sent successfully or not
and then throw an exception if needed…?


#4

Its weird I’m actually having the exact same problem right now. I have
no idea how you would check your logs.

In your code above, have you tried changing the domain to psyguide.org
and not mail.psyguide.org?


#5

Lugovoi N. wrote:

2006/1/24, Joshua M. removed_email_address@domain.invalid:

  1. You can explicitly enforce some rules (in environment.rb):
    ActionMailer::Base.delivery_method = :smtp
    ActionMailer::Base.perform_deliveries = true
    ActionMailer::Base.raise_delivery_errors = true

and send email (using ActionMailer), say, to your own email address.
(Maybe problem isn’t ActionMailer, but mailserver?)

  1. Run in development environment, so if you get Application Error you
    can trace down where it happens and debug if needed

HTH

If I add those to environment.rb I get a big ass error

Net::SMTPSyntaxError in Email#confirm
502 Error: command not implemented


#6

2006/1/24, Joshua M. removed_email_address@domain.invalid:

  1. You can explicitly enforce some rules (in environment.rb):
    ActionMailer::Base.delivery_method = :smtp
    ActionMailer::Base.perform_deliveries = true
    ActionMailer::Base.raise_delivery_errors = true

and send email (using ActionMailer), say, to your own email address.
(Maybe problem isn’t ActionMailer, but mailserver?)

  1. Run in development environment, so if you get Application Error you
    can trace down where it happens and debug if needed

HTH


#7

Joshua M. wrote:

Thanks, I got the error that the e-mail removed_email_address@domain.invalid doesn’t
exist (which is correct). I changed it to a correct e-mail, and now it
works. Thanks a lot! :slight_smile:

Btw. what should be the correct settings for a productive environment?
There I don’t want to see the user such warnings…

I’m glad you found the problem.

I’m getting this error
502 Error: command not implemented
RAILS_ROOT: /Users/alexp/Sites/pulse/script/…/config/…
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/1.8/net/smtp.rb:680:in check_response' /usr/lib/ruby/1.8/net/smtp.rb:582:inauth_login’
/usr/lib/ruby/1.8/net/smtp.rb:581:in critical' /usr/lib/ruby/1.8/net/smtp.rb:581:inauth_login’
/usr/lib/ruby/1.8/net/smtp.rb:571:in __send__' /usr/lib/ruby/1.8/net/smtp.rb:571:inauthenticate’
/usr/lib/ruby/1.8/net/smtp.rb:411:in do_start' /usr/lib/ruby/1.8/net/smtp.rb:378:instart’
/usr/lib/ruby/1.8/net/smtp.rb:316:in `start’

Does that mean my code is wrong or the smtp settings?


#8

2006/1/24, Alexander P. removed_email_address@domain.invalid:

I’m getting this error
502 Error: command not implemented

These are really essential points, thanks for providing:

/usr/lib/ruby/1.8/net/smtp.rb:582:in auth_login' /usr/lib/ruby/1.8/net/smtp.rb:571:inauthenticate’

So, it’s your SMTP server that says it can’t handle command AUTH LOGIN

Does that mean my code is wrong or the smtp settings?

Try to change in environment.rb:
ActionMailer::Base.server_settings = {
… # here go your server settings
:authentication => :plain #or omit this line if your server doesn’t
require authentication
}

Hint: you can check your SMTP sever via telnet (google a little about
SMTP command and telnet use :slight_smile:

HTH


#9

Thanks, I got the error that the e-mail removed_email_address@domain.invalid doesn’t
exist (which is correct). I changed it to a correct e-mail, and now it
works. Thanks a lot! :slight_smile:

Btw. what should be the correct settings for a productive environment?
There I don’t want to see the user such warnings…


#10

Yep I tried all that earlier