# 501 Bad Recipient Address Syntax

**URL:** <https://www.ruby-forum.com/t/501-bad-recipient-address-syntax/121720>\
**Category:** Rails\
**Created:** [November 30, 2007, 6:42am UTC](https://www.ruby-forum.com/t/501-bad-recipient-address-syntax/121720 "2007-11-30T06:42:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mendicant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/91b2a8/32.png) [@mendicant](https://www.ruby-forum.com/u/mendicant)\
**Post date:** [November 30, 2007, 6:42am UTC](https://www.ruby-forum.com/t/501-bad-recipient-address-syntax/121720/1 "2007-11-30T06:42:03Z")

</div>

Hi,

I’m having a problem with sending email with ActionMailer.

My mailer looks something like this:

class PNGMailer \< ActionMailer::Base

def forgotten\_password\_email (password\_reset, user)  
recipients = user.email  
from = “removed\_email\_address@domain.invalid”  
subject = “Password Change Request”

```
body :first_name => user.first_name, :last_name => user.last_name

```

end

end

I have checked a million times that recipients is set to a valid email  
address.

When I check my postfix logs, I get the following message:

warning: Illegal address syntax from localhost[127.0.0.1] in RCPT  
command: \<\>

It appears that somewhere down the line, I am losing the recipient email  
address.

Even more odd is the fact that this code works fine on my dev computer.  
Just not on my server.

Any ideas?

Thanks.

---

<div class="post-metadata">

**Author:** ![mendicant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/91b2a8/32.png) [@mendicant](https://www.ruby-forum.com/u/mendicant)\
**Post date:** [November 30, 2007, 6:47am UTC](https://www.ruby-forum.com/t/501-bad-recipient-address-syntax/121720/2 "2007-11-30T06:47:25Z")

</div>

Mendicant Zero x wrote:

> Hi,
> 
> I’m having a problem with sending email with ActionMailer.
> 
> My mailer looks something like this:
> 
> class PNGMailer \< ActionMailer::Base
> 
> def forgotten\_password\_email (password\_reset, user)  
> recipients = user.email  
> from = “removed\_email\_address@domain.invalid”  
> subject = “Password Change Request”
> 
> ```
> body :first_name => user.first_name, :last_name => user.last_name
> 
> ```
> 
> end
> 
> end

Sorry to bother, but it appears my problem has to do with needing it to  
be @recipients, not just recipients.
