# SMTPSyntaxError with Action Mailer

**URL:** <https://www.ruby-forum.com/t/smtpsyntaxerror-with-action-mailer/53083>\
**Category:** Rails\
**Created:** [January 24, 2006, 10:09pm UTC](https://www.ruby-forum.com/t/smtpsyntaxerror-with-action-mailer/53083 "2006-01-24T22:09:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9a140/32.png) [@alexp](https://www.ruby-forum.com/u/alexp)\
**Post date:** [January 24, 2006, 10:09pm UTC](https://www.ruby-forum.com/t/smtpsyntaxerror-with-action-mailer/53083/1 "2006-01-24T22:09:49Z")

</div>

I’ve been trying to get my action mailer powered form to work all day. I  
can get it to work perfectly in development mode.  
But when I run it in production mode I get an error, the log spits this  
out

Net::SMTPSyntaxError (501 Syntax: HELO hostname  
):  
/usr/lib/ruby/1.8/net/smtp.rb:680:in `check_response' /usr/lib/ruby/1.8/net/smtp.rb:653:in `getok’  
/usr/lib/ruby/1.8/net/smtp.rb:623:in `helo' /usr/lib/ruby/1.8/net/smtp.rb:401:in `do\_start’  
/usr/lib/ruby/1.8/net/smtp.rb:378:in `start' /usr/lib/ruby/1.8/net/smtp.rb:316:in `start’  
/usr/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action\_mailer/base.rb:436:in  
`perform_delivery_smtp' /usr/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:327:in `send’  
/usr/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action\_mailer/base.rb:327:in  
`deliver!' /usr/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:223:in `method\_missing’  
/app/controllers/email\_controller.rb:9:in `message' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:in `send’  
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_controller/base.rb:853:in  
`perform_action_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/filters.rb:332:in `perform\_action\_without\_benchmark’  
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_controller/benchmarking.rb:69:in  
`perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in `measure’  
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_controller/benchmarking.rb:69:in  
`perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/rescue.rb:82:in `perform\_action’  
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_controller/base.rb:369:in  
`send' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:in `process\_without\_session\_management\_support’  
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_controller/session\_management.rb:116:in  
`process' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in `dispatch’  
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi\_handler.rb:141:in  
`process_request' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:53:in `process!’  
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi\_handler.rb:52:in  
`each_cgi' /usr/lib/ruby/1.8/fcgi.rb:597:in `each’  
/usr/lib/ruby/1.8/fcgi.rb:597:in `each_cgi' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in `process!’  
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi\_handler.rb:22:in  
`process!’  
dispatch.fcgi:24

I looked into HELO and it seems to have something to do with the  
hostname obviously but I cant see anything wrong with it.

my production.rb code is

ActionMailer::Base.server\_settings = {  
:address =\> “[mail.pulsedev.net](http://mail.pulsedev.net)”,  
:port =\> 25,  
:domain =\> “[pulsedev.net](http://pulsedev.net)”,  
:authentication =\> :login,  
:user\_name =\> “m9472838”,  
:password =\> “sirius”,  
}

Any help would be great thanks

---

<div class="post-metadata">

**Author:** ![alexp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9a140/32.png) [@alexp](https://www.ruby-forum.com/u/alexp)\
**Post date:** [January 24, 2006, 10:22pm UTC](https://www.ruby-forum.com/t/smtpsyntaxerror-with-action-mailer/53083/2 "2006-01-24T22:22:22Z")

</div>

Ben R. wrote:

> Hi Alex ~
> 
> I am sure your issue is with configuration, but in the future I wouldn’t  
> advise posting one’s password.
> 
> ~ Ben

Thanks but what configuration? the code for the production.rb or the  
rest of it? It works fine in development mode so I dont see how it could  
be that.

But on the other hand I’ve tried everything in production.rb.

---

<div class="post-metadata">

**Author:** ![alexp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9a140/32.png) [@alexp](https://www.ruby-forum.com/u/alexp)\
**Post date:** [January 24, 2006, 10:14pm UTC](https://www.ruby-forum.com/t/smtpsyntaxerror-with-action-mailer/53083/3 "2006-01-24T22:14:26Z")

</div>

Hi Alex ~

I am sure your issue is with configuration, but in the future I wouldn’t  
advise posting one’s password.

~ Ben

---

<div class="post-metadata">

**Author:** ![alexp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9a140/32.png) [@alexp](https://www.ruby-forum.com/u/alexp)\
**Post date:** [February 1, 2006, 8:20pm UTC](https://www.ruby-forum.com/t/smtpsyntaxerror-with-action-mailer/53083/4 "2006-02-01T20:20:14Z")

</div>

I had this same problem and was able to get it to work by changing this  
line in my production.rb file:

#config.action\_mailer.raise\_delivery\_errors = false

Uncomment that line (which is the default in the development.rb) and it  
should send emails - I consider this a workaround because I could not  
determine the actual source of the error.

Dave

---

<div class="post-metadata">

**Author:** ![alexp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9a140/32.png) [@alexp](https://www.ruby-forum.com/u/alexp)\
**Post date:** [January 25, 2006, 7:40am UTC](https://www.ruby-forum.com/t/smtpsyntaxerror-with-action-mailer/53083/5 "2006-01-25T07:40:28Z")

</div>

> Thanks but what configuration? the code for the production.rb or the  
> rest of it? It works fine in development mode so I dont see how it could  
> be that.

If the mail gets sent in devel mode, your code is right. Are your  
production and development hosts the same?

–
