Are these settings correct for sending mail through Rails/Gmail?

Posted by aressidi on Stack Overflow See other posts from Stack Overflow or by aressidi
Published on 2010-06-01T17:02:13Z Indexed on 2010/06/06 9:02 UTC
Read the original article Hit count: 400

Hi there,

I spend a good deal of time building an email system for my Rails app that uses Gmail to send bulk mail to a list of opt-in users. I realize a shortcomming of using Google Apps for my mail, namely a rate limit on the number of emails it will send out (i believe 500). Anyway, I have reached out to my users to see how many have received the email, and a lot of them have not, though some have. The list I tried sending to was about 540 users, so I would have expected more "yes, got it," then "nope, still waiting" responses.

I have two questions:

  1. Do these settings look correct for outgoing bulk mailing through Gmail? Again, using google apps to manage my domain and i know some people (including myself) have received the mailer. This is in a mail.rb initializer in my app.

    ActionMailer::Base.delivery_method = :sendmail
    ActionMailer::Base.smtp_settings = {
      :address => "smtp.gmail.com",
      :port => 25,
      :domain => "mydomain.com",
      :authentication => :login,
      :user_name => "[email protected]",
      :password => "mypass"
    }
    
  2. Is there any way I can test if the mail was delivered, or at least attempted to be delivered? I can't tell where in the list the mailer stops mailing! The way I generate the list is through a query which then passes the user info to a mailer worker which sends the emails out via Starling/Workling. Any advice here would be useful. Happy to post code, but want to make sure the method I'm using is sound.

Thanks for the help!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about gmail