# DreamHost and ActionMailer

**URL:** <https://www.ruby-forum.com/t/dreamhost-and-actionmailer/76850>\
**Category:** Rails\
**Created:** [March 5, 2006, 6:29am UTC](https://www.ruby-forum.com/t/dreamhost-and-actionmailer/76850 "2006-03-05T06:29:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [March 5, 2006, 6:29am UTC](https://www.ruby-forum.com/t/dreamhost-and-actionmailer/76850/1 "2006-03-05T06:29:07Z")

</div>

I’m getting ready to sign up with DreamHost, but my application is  
missing the ActionMailer features.

First, can anyone provide some real code to send an email upon comment  
submission?

Second, is it easy to setup ActionMailer on a DreamHost server?

Thanks!

---

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [March 5, 2006, 11:47am UTC](https://www.ruby-forum.com/t/dreamhost-and-actionmailer/76850/2 "2006-03-05T11:47:44Z")

</div>

ryan

```
> Second, is it easy to setup ActionMailer on a DreamHost server?

```

Yes it is :  
1/create a mail user  
amailusername/amailpassword

2/In environment.rb, add code like this:

ActionMailer::Base.delivery\_method = :smtp  
ActionMailer::Base.server\_settings = {  
:address =\> “[mail.myfoorailsapp.mydomain.net](http://mail.myfoorailsapp.mydomain.net)” ,  
:port =\> 587 ,  
:domain =\> “[myfoorailsapp.mydomain.net](http://myfoorailsapp.mydomain.net)” ,  
:authentication =\> :login ,  
:user\_name =\> “amailusername” ,  
:password =\> “amailpassword” ,  
}  
ActionMailer::Base.perform\_deliveries = true  
ActionMailer::Base.default\_charset = “utf-8”

Alain

---

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [March 5, 2006, 4:19pm UTC](https://www.ruby-forum.com/t/dreamhost-and-actionmailer/76850/3 "2006-03-05T16:19:54Z")

</div>

And don’t forget that the Rails community has generously provided  
DreamHost promo codes to get the maximum amount off

[http://wiki.rubyonrails.org/rails/pages/DreamhostRailsPromoCodes](http://wiki.rubyonrails.org/rails/pages/DreamhostRailsPromoCodes)

Cheers,

~William  
[http://www.railshosting.org](http://www.railshosting.org)

---

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [April 7, 2007, 6:02am UTC](https://www.ruby-forum.com/t/dreamhost-and-actionmailer/76850/4 "2007-04-07T06:02:51Z")

</div>

port 587 is for secure smtp, and I don’t know if dreamhost supports  
this,  
try changing port to 25, also the user should be removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [April 7, 2007, 12:33am UTC](https://www.ruby-forum.com/t/dreamhost-and-actionmailer/76850/5 "2007-04-07T00:33:48Z")

</div>

Alain R. wrote:

> ryan
> 
> ```
> > Second, is it easy to setup ActionMailer on a DreamHost server?
> 
> ```
> 
> Yes it is :  
> 1/create a mail user  
> amailusername/amailpassword
> 
> 2/In environment.rb, add code like this:
> 
> ActionMailer::Base.delivery\_method = :smtp  
> ActionMailer::Base.server\_settings = {  
> :address =\> “[mail.myfoorailsapp.mydomain.net](http://mail.myfoorailsapp.mydomain.net)” ,  
> :port =\> 587 ,  
> :domain =\> “[myfoorailsapp.mydomain.net](http://myfoorailsapp.mydomain.net)” ,  
> :authentication =\> :login ,  
> :user\_name =\> “amailusername” ,  
> :password =\> “amailpassword” ,  
> }  
> ActionMailer::Base.perform\_deliveries = true  
> ActionMailer::Base.default\_charset = “utf-8”
> 
> Alain

I cannot get this to work. No errors either, I just never get any mail  
received in my tests.

For the login, should I use mXXXXX or the removed\_email\_address@domain.invalid? I’ve tried  
both but am curious if one is correct over the other.

---

<div class="post-metadata">

**Author:** ![ryan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@ryan](https://www.ruby-forum.com/u/ryan)\
**Post date:** [April 7, 2007, 5:21pm UTC](https://www.ruby-forum.com/t/dreamhost-and-actionmailer/76850/6 "2007-04-07T17:21:09Z")

</div>

Dutch Rapley wrote:

> port 587 is for secure smtp, and I don’t know if dreamhost supports  
> this,  
> try changing port to 25, also the user should be removed\_email\_address@domain.invalid

Thanks.

I finally got this combination working:

ActionMailer::Base.delivery\_method = :smtp  
ActionMailer::Base.server\_settings = {  
:address =\> “[mail.myfoorailsapp.mydomain.net](http://mail.myfoorailsapp.mydomain.net)”  
:port =\> 587  
:domain =\> “[myfoorailsapp.mydomain.net](http://myfoorailsapp.mydomain.net)”  
:authentication =\> “removed\_email\_address@domain.invalid”  
:user\_name =\> “amailusername”  
:password =\> “amailpassword”  
}  
ActionMailer::Base.perform\_deliveries = true  
ActionMailer::Base.default\_charset = “utf-8”
