# Mass mailing through ar\_mailer - error

**URL:** <https://www.ruby-forum.com/t/mass-mailing-through-ar-mailer-error/129100>\
**Category:** Rails\
**Created:** [February 14, 2008, 8:25am UTC](https://www.ruby-forum.com/t/mass-mailing-through-ar-mailer-error/129100 "2008-02-14T08:25:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![priyasaini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/aca169/32.png) [@priyasaini](https://www.ruby-forum.com/u/priyasaini)\
**Post date:** [February 14, 2008, 8:25am UTC](https://www.ruby-forum.com/t/mass-mailing-through-ar-mailer-error/129100/1 "2008-02-14T08:25:47Z")

</div>

Hi:

I am trying to use ar\_mailer for sending mass mail.  
The model file looks like  
class Email \< ActionMailer::ARMailer  
def testmail  
recipients “…”  
from “…”  
subject “TEST MAIL SUBJECT”  
body “  
TEST MAIL MESSAGE”  
content\_type “text/html”  
end  
end  
where … is the email address

I have made this entry in environment.rb  
require ‘action\_mailer/ar\_mailer’

and this in development.rb  
ActionMailer::Base.delivery\_method = :activerecord

(since im in development env)

i have the table called emails with structure  
CREATE TABLE `emails` (  
`from` varchar(255) NOT NULL,  
`to` varchar(255) NOT NULL,  
`last_send_attempt` int(11) NOT NULL default ‘0’,  
`mail` text NOT NULL,  
`created_on` date NOT NULL  
)

When i try to call the method testmail it returns me an error saying…  
NoMethodError in UserController#test\_mail

undefined method `create’ for Email:Class

Plz can anybody guide me in the right direction.

TIA…

Best Regards,  
Priya S.

---

<div class="post-metadata">

**Author:** ![priyasaini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/aca169/32.png) [@priyasaini](https://www.ruby-forum.com/u/priyasaini)\
**Post date:** [July 31, 2008, 11:55am UTC](https://www.ruby-forum.com/t/mass-mailing-through-ar-mailer-error/129100/2 "2008-07-31T11:55:29Z")

</div>

Hi priya…

Can u please write a steps how to use ar\_mailer…  
I am not getting any error bue my mains are not getting stored in  
database…

ripan

On Feb 14, 12:25 pm, Priya S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
