I use my Gmail Apps for Domain account to send emails in my rails application for standard automatic emails (user registration, forgot password, notification notification for new comment, etc.), but I'm worried about 500 messages for each daily limit, installed by Google.
Google offers one way to break the limit - use multiple user accounts.
So, I set up 10 additional gmail user accounts (noreply1, noreply2, noreply3, etc.). I would like to track when any of these accounts sent 500 emails within 24 hours, and use the account,
How do I dynamically set the value :user_name in ActionMailer::Base.smtp_settings ?
Here my current setup is NOTE: this is sent with "noreply1" every time, although I explicitly set: user_name and: from to "noreply2":
--- development.rb --- ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => "587", :domain => "mydomain.com", :authentication => :plain, :user_name => " noreply1@mydomain.com ", :password => "password" } --- account.rb --- (MODEL, called via a callback) after_create :send_welcome_email ... def send_welcome_email
email ruby-on-rails smtp
Jim jones
source share