# Strange email syntax issue with ActionMailer

**URL:** <https://www.ruby-forum.com/t/strange-email-syntax-issue-with-actionmailer/176938>\
**Category:** Rails\
**Created:** [October 8, 2009, 5:11pm UTC](https://www.ruby-forum.com/t/strange-email-syntax-issue-with-actionmailer/176938 "2009-10-08T17:11:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaczheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/edb3f5/32.png) [@zaczheng](https://www.ruby-forum.com/u/zaczheng)\
**Post date:** [October 8, 2009, 5:11pm UTC](https://www.ruby-forum.com/t/strange-email-syntax-issue-with-actionmailer/176938/1 "2009-10-08T17:11:15Z")

</div>

I am getting a peculiar syntax error with when setting the from email  
address in an ActionMailer class, like this:

from ‘Email [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)’

This is a valid email address as shown on  
[ActionMailer::Base](http://api.rubyonrails.org/classes/ActionMailer/Base.html#M001561) (see  
bbc email).

But I am receiving this error:

Net::SMTPSyntaxError (501 Syntax error in parameters or arguments  
):  
/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:631:in `mailfrom' /usr/lib/ruby/1.8/net/smtp.rb:544:in `send0’  
/usr/lib/ruby/1.8/net/smtp.rb:472:in `sendmail' /usr/lib/ruby/1.8/net/smtp.rb:379:in `start’

The email sends file when it is:  
from ‘[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)’

But the mail server I’m using requires the text before it.

I have no idea what is going on. Any help is greatly appreciated!

Zac

---

<div class="post-metadata">

**Author:** ![zaczheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/edb3f5/32.png) [@zaczheng](https://www.ruby-forum.com/u/zaczheng)\
**Post date:** [October 8, 2009, 5:37pm UTC](https://www.ruby-forum.com/t/strange-email-syntax-issue-with-actionmailer/176938/2 "2009-10-08T17:37:32Z")

</div>

I’m showing my retardedness again!

From email can’t not have description before the email address. To, cc  
and bcc can. ActionMailer rdoc where description(description  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)) was used, was in bcc.

RTC 821 is my friend:  
[http://james.apache.org/server/rfclist/smtp/rfc0821.txt](http://james.apache.org/server/rfclist/smtp/rfc0821.txt)

---

<div class="post-metadata">

**Author:** ![zaczheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/edb3f5/32.png) [@zaczheng](https://www.ruby-forum.com/u/zaczheng)\
**Post date:** [October 8, 2009, 5:35pm UTC](https://www.ruby-forum.com/t/strange-email-syntax-issue-with-actionmailer/176938/3 "2009-10-08T17:35:33Z")

</div>

Known issue with rails 2.3.3 & 2.3.4.

[https://rails.lighthouseapp.com/projects/8994/tickets/2340-action-mailer-cant-deliver-mail-via-smtp-on-ruby-191#ticket-2340-19](https://rails.lighthouseapp.com/projects/8994/tickets/2340-action-mailer-cant-deliver-mail-via-smtp-on-ruby-191#ticket-2340-19)

There is a workaround listed in the thread.

On Oct 8, 11:11 am, Zac Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![zaczheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/edb3f5/32.png) [@zaczheng](https://www.ruby-forum.com/u/zaczheng)\
**Post date:** [October 8, 2009, 5:53pm UTC](https://www.ruby-forum.com/t/strange-email-syntax-issue-with-actionmailer/176938/4 "2009-10-08T17:53:13Z")

</div>

lardawge wrote:

> Known issue with rails 2.3.3 & 2.3.4.
> 
> [#2340 action mailer can't deliver mail via smtp on ruby 1.9.1 or 1.8.7 - Ruby on Rails - rails](https://rails.lighthouseapp.com/projects/8994/tickets/2340-action-mailer-cant-deliver-mail-via-smtp-on-ruby-191#ticket-2340-19)
> 
> There is a workaround listed in the thread.

Thanks!
