# Has anybody made actionmailer work with rails 2.3.5?

**URL:** <https://www.ruby-forum.com/t/has-anybody-made-actionmailer-work-with-rails-2-3-5/184571>\
**Category:** Rails\
**Created:** [March 4, 2010, 6:24pm UTC](https://www.ruby-forum.com/t/has-anybody-made-actionmailer-work-with-rails-2-3-5/184571 "2010-03-04T18:24:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f4b2a3/32.png) [@bigos](https://www.ruby-forum.com/u/bigos)\
**Post date:** [March 4, 2010, 6:24pm UTC](https://www.ruby-forum.com/t/has-anybody-made-actionmailer-work-with-rails-2-3-5/184571/1 "2010-03-04T18:24:24Z")

</div>

Hi,

I have wasted few days and I’m not getting anywhere. I was trying to  
follow tutorial on Rails Guides and this one:  
[Ruby on Rails - Send Emails | Tutorialspoint](http://www.tutorialspoint.com/ruby-on-rails/rails-send-email.htm) .

All I need is to be able to send some text, nothing fancy. Why in  
Rails it has to be so difficult? Why it can’t be so simple as in PHP?

Can anybody point me to some good simple tutorial, explaining how to  
do it from the beginning to the end?  
I don’t want some tutorial that tries to explain lots of complicated  
stuff, skipping things needed by beginners.

Thank you very much in advance.

Jack

---

<div class="post-metadata">

**Author:** ![bigos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f4b2a3/32.png) [@bigos](https://www.ruby-forum.com/u/bigos)\
**Post date:** [March 5, 2010, 1:18am UTC](https://www.ruby-forum.com/t/has-anybody-made-actionmailer-work-with-rails-2-3-5/184571/2 "2010-03-05T01:18:17Z")

</div>

I can do it PHP way using:

require ‘net/smtp’  
Net::SMTP.start(…) do |smtp|  
…

but I didn’t give up trying to do it Rails way. I hope someone will  
point me in right direction.

Jack

---

<div class="post-metadata">

**Author:** ![bigos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f4b2a3/32.png) [@bigos](https://www.ruby-forum.com/u/bigos)\
**Post date:** [March 5, 2010, 3:26am UTC](https://www.ruby-forum.com/t/has-anybody-made-actionmailer-work-with-rails-2-3-5/184571/3 "2010-03-05T03:26:28Z")

</div>

On Mar 4, 6:16 pm, Bigos [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I can do it PHP way using:
> 
> require ‘net/smtp’  
> Net::SMTP.start(…) do |smtp|  
> …
> 
> but I didn’t give up trying to do it Rails way. I hope someone will  
> point me in right direction.
> 
> Jack

Hi Jack,

I don’t have a tutorial link handy, but here is a very simple example  
that I just hacked together (very quickly). Maybe this will get you  
started!

> <https://gist.github.com/phillipkoebbe/322378>

Start a new project, make those changes, fire up the server with  
script/server, navigate to [http://localhost:3000/test/send\_mail](http://localhost:3000/test/send_mail), then  
look in your development log. You should see something that resembles  
what is below.

Peace,  
Phillip

====================================================

Processing TestController#send\_mail (for 127.0.0.1 at 2010-03-04  
20:05:33) [GET]  
Sent mail to removed\_email\_address@domain.invalid

Date: Thu, 4 Mar 2010 20:05:33 -0600  
From: removed\_email\_address@domain.invalid  
To: removed\_email\_address@domain.invalid  
Subject: Test Message  
Mime-Version: 1.0  
Content-Type: text/plain; charset=utf-8

Hi There.  
Completed in 6ms (View: 0, DB: 0) | 200 OK [[http://localhost/test/](http://localhost/test/)  
send\_mail]

---

<div class="post-metadata">

**Author:** ![bigos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f4b2a3/32.png) [@bigos](https://www.ruby-forum.com/u/bigos)\
**Post date:** [March 5, 2010, 7:15pm UTC](https://www.ruby-forum.com/t/has-anybody-made-actionmailer-work-with-rails-2-3-5/184571/4 "2010-03-05T19:15:26Z")

</div>

I have managed to make it work. After changing config/environments/  
development.rb to look like:

config.action\_mailer.raise\_delivery\_errors = true  
config.action\_mailer.perform\_deliveries = true

config.action\_mailer.delivery\_method = :sendmail ####

Now everything works fine on my system. Adding config line marked with  
‘####’ to make rails use :sendmail and restarting mongrel made  
everything work perfectly.

---

<div class="post-metadata">

**Author:** ![bigos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f4b2a3/32.png) [@bigos](https://www.ruby-forum.com/u/bigos)\
**Post date:** [March 7, 2010, 10:06am UTC](https://www.ruby-forum.com/t/has-anybody-made-actionmailer-work-with-rails-2-3-5/184571/5 "2010-03-07T10:06:02Z")

</div>

see this

[![](https://img.youtube.com/vi/iJZ8w5o_TkE/maxresdefault.jpg "Ruby on Rails: ActionMailer and Gmail") ](https://www.youtube.com/watch?v=iJZ8w5o_TkE)

may be u get some idea

Regards,  
Shyam  
+91-9716-18-9650

---

<div class="post-metadata">

**Author:** ![bigos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f4b2a3/32.png) [@bigos](https://www.ruby-forum.com/u/bigos)\
**Post date:** [March 5, 2010, 8:08pm UTC](https://www.ruby-forum.com/t/has-anybody-made-actionmailer-work-with-rails-2-3-5/184571/6 "2010-03-05T20:08:42Z")

</div>

On Mar 5, 12:14 pm, Bigos [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> everything work perfectly.  
> Yah. I left that one for you to find yourself. Good job!

Glad it’s working for you now. I hope your experience with Rails is  
less frustrating from now on. When I first came to Rails about 3 years  
ago, it took me a couple of months to get my head wrapped around both  
Ruby and Rails. But once I did, I really felt at home and became a  
much happier programmer 🙂

Peace,  
Phillip
