WebFaction
Community site: login faq

I'm attempting to correctly configure Rails 3 Action Mailer initializers to send mail from my domain. I thought it might be helpful to gather that information here, since the other docs I see are for Rails 2, or may be out-of-date.

For reference, users can look at Railscasts.com's "Action Mailer in Rails 3" to learn how to set up an Action Mailer controller in Rails 3.

My question however is just on how to set up the smtp configuration properly with the correct username.

I am trying this from my local development server.


Environments/development.rb (Action Mailer snippet):

  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true


Initializer mail.rb (full file):

ActionMailer::Base.smtp_settings = {
 :address               => "smtp.webfaction.com",
 :domain                => "smtp.webfaction.com",
 :authentication        => :login,
 :user_name             => "mailbox_username",
 :password              => "mailbox_password"
}

ActionMailer::Base.default_url_options[:host] = "mydomain.com"

However, with these settings, I am not actually sending any mail. The mailbox itself does work, so I am deducing that it is just an SMTP settings problem.

asked 03 Jan '11, 16:37

kevindickerson
21136
accept rate: 0%


Domain should be your domain,

 :domain                => "mydomain.com",

If the sending address is wrong it may fail. If you submit a support ticket with the sending mailbox we can look at the logs and see exactly why it is failing.

permanent link

answered 03 Jan '11, 17:06

johns
5.4k312
accept rate: 23%

These initializer settings to configure Action Mailer in Rails 3 worked for me:

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
 :address               => "smtp.webfaction.com",
 :port => 587,
 :domain                => "mydomain.com",
 :user_name             => "mailbox_user",
 :password              => "mailbox_password",
 :enable_starttls_auto => true
}

Thanks support guys!

permanent link

answered 06 Jan '11, 19:23

kevindickerson
21136
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×108
×69
×28
×1
×1

question asked: 03 Jan '11, 16:37

question was seen: 14,373 times

last updated: 06 Jan '11, 19:23

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM