# Actionmailer and Mass Mailing

**URL:** <https://www.ruby-forum.com/t/actionmailer-and-mass-mailing/181422>\
**Category:** Rails\
**Created:** [January 11, 2010, 6:36pm UTC](https://www.ruby-forum.com/t/actionmailer-and-mass-mailing/181422 "2010-01-11T18:36:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![serpico](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@serpico](https://www.ruby-forum.com/u/serpico)\
**Post date:** [January 11, 2010, 6:36pm UTC](https://www.ruby-forum.com/t/actionmailer-and-mass-mailing/181422/1 "2010-01-11T18:36:41Z")

</div>

Hello, I’m having a problem with actionmailer and mass (sort of)  
mailing.

Basically, sometimes I need to notify every subscribed user in my app by  
mail. Since the amout of users is very small (subscription is not  
public), i thought that actionmailer would be enough.

When i need to send these email I do something like:

for user in Users.all  
Mailer.deliver\_notification(user.email)  
end

It works sometimes, but i randomly get a “554 Policy Violation” error  
from the mail server teling something about spam protection. I suppose  
that every call to Mailer.deliver\_something… opens and closes a  
connection with the server, therefore the server is probably complaing  
about that since I send almost 100 emails in a short period of time.  
Sending a single mail with multiple recipients it’s not what I really  
want unfortunately.

Is there a simple solution to this problem without using things like  
ar\_mailer or similar? Is it really a problem for the mail server to get  
so many mails at once to send or should I complain about that with the  
mail server owners?

I hope the problem is clear, my english is not so good.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![serpico](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@serpico](https://www.ruby-forum.com/u/serpico)\
**Post date:** [January 11, 2010, 6:51pm UTC](https://www.ruby-forum.com/t/actionmailer-and-mass-mailing/181422/2 "2010-01-11T18:51:09Z")

</div>

My guess is that you need to get your email account verified with the  
smtp service provider to send that many emails. As far as I know, you  
can send up to 500 a day through gmail, so that may be an option.

On Mon, Jan 11, 2010 at 9:36 AM, Serafino P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> ## Â Â Mailer.deliver\_notification(user.email) Is there a simple solution to this problem without using things like
> 
> You received this message because you are subscribed to the Google G. “Ruby on Rails: Talk” group.  
> To post to this group, send email to removed\_email\_address@domain.invalid.  
> To unsubscribe from this group, send email to removed\_email\_address@domain.invalid.  
> For more options, visit this group at [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

# – Curtis C. removed\_email\_address@domain.invalid home:[http://curtiscooley.com](http://curtiscooley.com) blog:[http://ponderingobjectorienteddesign.blogspot.com](http://ponderingobjectorienteddesign.blogspot.com)

Leadership is a potent combination of strategy and character. But if  
you must be without one, be without the strategy.  
– H. Norman Schwarzkopf
