# Receiving email via Rails app?

**URL:** <https://www.ruby-forum.com/t/receiving-email-via-rails-app/90588>\
**Category:** Rails\
**Created:** [March 30, 2007, 3:34am UTC](https://www.ruby-forum.com/t/receiving-email-via-rails-app/90588 "2007-03-30T03:34:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [March 30, 2007, 3:34am UTC](https://www.ruby-forum.com/t/receiving-email-via-rails-app/90588/1 "2007-03-30T03:34:37Z")

</div>

I need to be able to read email from an account on my Dreamhost server  
using a Rails app. I want to accept data and images via email if  
possible.

Can anyone point me to a tutorial or other resource that would help me  
accomplish this?

Thanks,  
Nathan

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [March 30, 2007, 4:29am UTC](https://www.ruby-forum.com/t/receiving-email-via-rails-app/90588/2 "2007-03-30T04:29:41Z")

</div>

Rails Cookbook.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [March 31, 2007, 7:56pm UTC](https://www.ruby-forum.com/t/receiving-email-via-rails-app/90588/3 "2007-03-31T19:56:08Z")

</div>

removed\_email\_address@domain.invalid wrote:

> I need to be able to read email from an account on my Dreamhost server using a Rails app. I want to accept data and images via email if possible.
> 
> Can anyone point me to a tutorial or other resource that would help me accomplish this?

See

> **[ActionMailer::Base](https://api.rubyonrails.org/classes/ActionMailer/Base.html)**
>
> Action Mailer allows you to send email from your application using a mailer model and views. Mailer Models To use Action Mailer, you need to create a mailer model.

You’ll need to create a controller subclass of actionmailer and define a  
receive method which handles the incoming email. Also consult the ruby  
documentatino on the Tmail class.

You’ll need to set up an automated way to feed the email to the  
actionmailer controller. Procmail works well for that if Dreamhost  
provides it. run “man procmail” on dreamhost to see the documentation  
on procmail.

The book _Agile Web D. with Rails_ has a chapter on processing  
email in rails.

Sincerely,  
Jason
