# Configure actionmailer to recieve email on localhost?

**URL:** <https://www.ruby-forum.com/t/configure-actionmailer-to-recieve-email-on-localhost/87543>\
**Category:** Rails\
**Created:** [March 3, 2007, 5:07pm UTC](https://www.ruby-forum.com/t/configure-actionmailer-to-recieve-email-on-localhost/87543 "2007-03-03T17:07:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mixplate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@mixplate](https://www.ruby-forum.com/u/mixplate)\
**Post date:** [March 3, 2007, 5:07pm UTC](https://www.ruby-forum.com/t/configure-actionmailer-to-recieve-email-on-localhost/87543/1 "2007-03-03T17:07:40Z")

</div>

hi, is there a way i can configure my localhost to receive email using  
smtp? i can out emails fine but now would like to test/get-to-know how  
to handle incoming emails.

if on my localhost:3000, do i do anything like below?

ActionMailer::Base.server\_settings = {

:address=\>‘[smtp.yourserver.com](http://smtp.yourserver.com)’, # default: localhost  
:port=\>‘25’, # default: 25  
:user\_name=\>‘user’,  
:password=\>‘pass’,  
:authentication=\>:plain # :plain, :login or :cram\_md5  
}

what do i use as an email address?

thanks

---

<div class="post-metadata">

**Author:** ![mixplate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@mixplate](https://www.ruby-forum.com/u/mixplate)\
**Post date:** [March 6, 2007, 2:00am UTC](https://www.ruby-forum.com/t/configure-actionmailer-to-recieve-email-on-localhost/87543/2 "2007-03-06T02:00:23Z")

</div>

Il giorno 03/mar/07, alle ore 17:07, mixplate ha scritto:

> :port=\>‘25’, # default: 25  
> :user\_name=\>‘user’,  
> :password=\>‘pass’,  
> :authentication=\>:plain # :plain, :login or :cram\_md5  
> }
> 
> what do i use as an email address?

Rails doesn’t care frome where you get your emails, you just have to  
forward them using script/runner YourMailer.receive(email) or more  
probably YourMailer.receive(STDIN.read).  
Personally I use getmail, you can find some docs on the wiki.  
The code you posted is for _sending_ emails.  
Receiving with SMTP is quite hard, you need POP3/imap.

Have fun !  
ngw

---

<div class="post-metadata">

**Author:** ![mixplate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@mixplate](https://www.ruby-forum.com/u/mixplate)\
**Post date:** [March 6, 2007, 2:19am UTC](https://www.ruby-forum.com/t/configure-actionmailer-to-recieve-email-on-localhost/87543/3 "2007-03-06T02:19:39Z")

</div>

mixplate wrote:

> hi, is there a way i can configure my localhost to receive email using  
> smtp? i can out emails fine but now would like to test/get-to-know how  
> to handle incoming emails.
> 
> if on my localhost:3000, do i do anything like below?
> 
> ActionMailer::Base.server\_settings = {
> 
> :address=\>‘[smtp.yourserver.com](http://smtp.yourserver.com)’, # default: localhost  
> :port=\>‘25’, # default: 25  
> :user\_name=\>‘user’,  
> :password=\>‘pass’,  
> :authentication=\>:plain # :plain, :login or :cram\_md5  
> }
> 
> what do i use as an email address?
> 
> thanks

If you are using unix based os (including Mac OSX), you can use

ActionMailer::Base.delivery\_method = :sendmail

and configure your sendmail to send emails out (on Mac OSX by default  
sendmail is disabled, you will have to enable it)

---

<div class="post-metadata">

**Author:** ![mixplate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@mixplate](https://www.ruby-forum.com/u/mixplate)\
**Post date:** [March 6, 2007, 3:22am UTC](https://www.ruby-forum.com/t/configure-actionmailer-to-recieve-email-on-localhost/87543/4 "2007-03-06T03:22:30Z")

</div>

On 5-Mar-07, at 7:59 PM, Nicholas W. wrote:

> > if on my localhost:3000, do i do anything like below?
> 
> Have fun !  
> ngw

If you’re on osx, and trying to pop gmail (a narrow set of choices?),  
this reference may help: [http://involution.com/2006/07/20/access-](http://involution.com/2006/07/20/access-)  
gmail-from-ruby-using-netpop3-and-stunnel/

cheers,  
Jodi
