I'm having trouble sending mail using SMTP from a Rails app. I have a Mailer
class:
class Mailer < ActionMailer::Base
def newsletter_confirmation(subscription)
recipients "[email protected]" # this is set to my email
# just for testing purposes and will
# be changed to subscription.email
from "\"my-valid-helo-domain.net\" <[email protected]>"
subject "Confirm your subscription"
body :subscription => subscription
end
end
When I try to send the mail, I get a Net::SMTPSyntaxError
:
501 <["[email protected]"]>: missing or malformed local part
If I comment out the from
field, the mail gets delivered ok, but with the from information missing (obviously).
Any ideas on what I'm doing wrong?
Thanks.
Edit: I'm using Rails 2.3.2 and Ruby 1.9.1