2

trying to set up my own ActionMailer::Base in RubyRails -> This works:

    ActionMailer::Base.smtp_settings = {
    :address              => "smtp.gmail.com",
    :port                 => 587,
    :domain               => "anythingworks",
    :user_name            => "[email protected]",
    :password             => "somePW",
    :authentication       => "plain",
    :enable_starttls_auto => true
    }

fine.. but it would be nice if I could use my mail server. but when i am trying this:

    ActionMailer::Base.smtp_settings = {
    :address              => "smtp.myowndomain.de",
    :port                 => 25, (tried 587) also
    :domain               => "triedanything",
    :user_name            => "mycorrectuser",
    :password             => "yesitisthecorretpw",
    :authentication       => "plain",
    :enable_starttls_auto => true
    }

Tried lot of different settings / changes. But no E-Mail is sent. Is there any logs avaiable to this ? Think its something because authentication... "login" instead of "plain" doesnt help...

Had some tests with telnet sending some E-mails from command line. gmail doesnt work from command line (saying STARTTTLS or something). My own domain mails server (which is hosted from some provider) says "relay access denied" (from commandline).

Webmail both working..

Any ideads ? Thanks!

2
  • Does enabling config.action_mailer.raise_delivery_errors = true provide any additional info? Commented Aug 17, 2013 at 0:14
  • hey, tried this in application.rb, didnt saw any additional info.
    – mho
    Commented Aug 17, 2013 at 10:52

1 Answer 1

1

The answer is the "relay access denied" message. Your smtp server needs to be configured to relay emails for this to work. I suspect that your smtp server is configured to accept connections for delivery TO your domain, not to relay emails elsewhere.

The same error message will probably be found in the smtp server's log files. Try sending an email to yourself (which would just be an accept, rather than a relay, for your smtp server). If emails to yourself are delivered, but emails to other domains are not, you will have confirmation that that is the problem.

Your ISP probably has an smtp server you can use for outgoing emails. If you want to use your own email server, it will need to be configured to relay emails.

1
  • Thanks, you answer helped me. As you suggested my smtp Server is doing something wrong. That was right. My ISP wrote something with TLS, it seems you need it here. With another SMTP Server it does work now. Thanks !
    – mho
    Commented Aug 17, 2013 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.