Net::SMTPSyntaxError (501 <>: missing or malformed local part
):
/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:635:in `rcptto'
/usr/lib/ruby/1.8/net/smtp.rb:546:in `send0'
/usr/lib/ruby/1.8/net/smtp.rb:545:in `send0'
/usr/lib/ruby/1.8/net/smtp.rb:472:in `sendmail'
/usr/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/action_mailer/base.rb:513:in
`perform_delivery_smtp'
/usr/lib/ruby/1.8/net/smtp.rb:379:in `start'
/usr/lib/ruby/1.8/net/smtp.rb:316:in `start'
/usr/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/action_mailer/base.rb:511:in
`perform_delivery_smtp'
/usr/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/action_mailer/base.rb:397:in
`deliver!'
/usr/lib/ruby/gems/1.8/gems/actionmailer-1.2.5/lib/action_mailer/base.rb:291:in
`method_missing'
/app/controllers/workout_controller.rb:58:in `notifyNewWorkout'
--
Posted via http://www.ruby-forum.com/.
They usually are something like:
"This is my name" <myn...@mydomain.com>
Jim Jones escribió:
class NewWorkoutNotify < ActionMailer::Base
def notify_new_workout(user)
# Email header info MUST be added here
@recipients = user.email
@from = "x...@yyyy.net"
@subject = "New Workout Ready"
# Email body substitutions go here
@body["login"] = user.login
end
end
Matias Surdi wrote:
> I think that you are entering some mail addres (to or from) in the wrong
> format.
>
> They usually are something like:
>
> "This is my name" <myn...@mydomain.com>
>
>
>
> Jim Jones
>escribigt;
I had 'recipients = XXXXXX' instead of 'recipients XXXXXX'
I found this by adding some logger.info statements in:
/usr/lib/ruby/gems/1.8/gems/actionmailer-2.1.1/lib/action_mailer/base.rb
...in the deliver! method. I then saw that there were no recipients
being given to net::smtp
Good luck!
Something that may also help debugging, you can hack
/usr/lib/ruby/1.8/net/smtp.rb and add a few print statements inside
get_response, recv_response, and getok, in order to see what is actually
coming to and from the SMTP server.
This helped me immensely. Be warned however, as this will cause ugly
text to be printed on every app on your server that uses these
libraries.
For example, I was passing an email address like this: " Bob Smith
<bob....@gmail.com>" and was getting the error.
As soon as I stripped the space away with '.strip' before I assigned it
to 'recipients', the error went away.
Not sure which part of the code (gem or ruby) was choking on the
whitespace. I didn't investigate further. I am using Action::Mailer
2.2.2.