# Getting Rails to send email

**URL:** <https://www.ruby-forum.com/t/getting-rails-to-send-email/163520>\
**Category:** Rails\
**Created:** [March 21, 2009, 12:39pm UTC](https://www.ruby-forum.com/t/getting-rails-to-send-email/163520 "2009-03-21T12:39:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [March 21, 2009, 12:39pm UTC](https://www.ruby-forum.com/t/getting-rails-to-send-email/163520/1 "2009-03-21T12:39:09Z")

</div>

I have a site that I want to send out emails for when people forget  
their password. I’ve read the various articles on how to get Rails to  
send emails but what I need is how to set up the software to allow  
emails to be sent at all. I once say an article that covered setting  
up exim / postfix but can’t find it anymore. Does anyone know what  
packages I need to install and how I might configure them or some  
pointers to where I can find this out?

I am running debian 4.0

Thanks

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [March 21, 2009, 12:53pm UTC](https://www.ruby-forum.com/t/getting-rails-to-send-email/163520/2 "2009-03-21T12:53:12Z")

</div>

Hi Hickman,

Check out the documentation in

> **[rails.info](http://guides.rails.info/action_mailer_basics.html)**
>
> Ruby on Rails,Rails Tutorial,Ruby Basics,Rails 4,Bar Rails,Rail

this is the default module for Rails.

I am using ruport(Ruby reports) to send email

gem install ruport  
gem install ruport-util

> > require ‘rubygems’  
> > require ‘ruport’  
> > require ‘ruport/util’

> > r = Ruport::Report.new  
> > r.add\_mailer :default, :host =\> “localhost”, :address =\> “removed\_email\_address@domain.invalid”  
> > r.send\_to(email\_id) do |mail|  
> > mail.subject = “Some subject”  
> > mail.text = “Some text”  
> > mail.html = “
> > 
> > # Hello World
> > ”  
> > end

For further info. check ruport documentation

Regards,  
Vimal Das

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [March 21, 2009, 5:13pm UTC](https://www.ruby-forum.com/t/getting-rails-to-send-email/163520/3 "2009-03-21T17:13:52Z")

</div>

No quite what I was looking for. I have seen plenty of documentation  
as to how to send mail from Ruby but they all assume that you have an  
MTA like sendmail, postfix or exim4 already set up. The machine that I  
have has neither installed or, obviously, configured.

I was thinking that this is the sort of problem that others must have  
encountered before and perhaps they could shed some light on what I  
should be looking for.

Thanks anyway

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [March 21, 2009, 6:59pm UTC](https://www.ruby-forum.com/t/getting-rails-to-send-email/163520/4 "2009-03-21T18:59:26Z")

</div>

Peter H. wrote:

> No quite what I was looking for. I have seen plenty of documentation  
> as to how to send mail from Ruby but they all assume that you have an  
> MTA like sendmail, postfix or exim4 already set up.  
> […]

To avoid the hassle of setting up Postfix or similar, I just give  
ActionMailer the connection info for my ISP’s SMTP server. That should  
do the trick.

## Best,

Marnen Laibow-Koser  
removed\_email\_address@domain.invalid  
[http://www.marnen.org](http://www.marnen.org)

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [March 22, 2009, 1:37am UTC](https://www.ruby-forum.com/t/getting-rails-to-send-email/163520/5 "2009-03-22T01:37:25Z")

</div>

Hey Peter,

Nicolai is correct, this isn’t really the right place for this kind of  
question. However, because I have recently setup a Postfix mail agent  
on Slicehost, I might be able to help you. Their documentation is  
actually really good. Additionally, if you just need outgoing mail  
(like sending emails to admin), then you probably won’t even have to  
configure ActionMailer (the default settings should work).

Check out the docs and if you are still having trouble, shoot me an  
email.  
[http://articles.slicehost.com/2008/7/29/postfix-installation](http://articles.slicehost.com/2008/7/29/postfix-installation)

HTH,  
Jason Arora

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [March 22, 2009, 1:10am UTC](https://www.ruby-forum.com/t/getting-rails-to-send-email/163520/6 "2009-03-22T01:10:30Z")

</div>

2009/3/21 Peter H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> No quite what I was looking for. I have seen plenty of documentation  
> as to how to send mail from Ruby but they all assume that you have an  
> MTA like sendmail, postfix or exim4 already set up. The machine that I  
> have has neither installed or, obviously, configured.

Hi Peter,

answering this question is out of the scope of this mailing list. You  
will  
find plenty of mail server installation guides via your favorite search  
enginee - or you can you existing mail accounts (see guides.rails.info).

Regards  
Nicolai
