我在使用 SMTP 从 Rails 应用程序发送邮件时遇到问题。我有一Mailer
堂课:
class Mailer < ActionMailer::Base
def newsletter_confirmation(subscription)
recipients "my-valid-email@gmail.com" # this is set to my email
# just for testing purposes and will
# be changed to subscription.email
from "\"my-valid-helo-domain.net\" <noreply@my-valid-helo-domain.net>"
subject "Confirm your subscription"
body :subscription => subscription
end
end
当我尝试发送邮件时,我得到一个Net::SMTPSyntaxError
:
501 <["noreply@my-valid-helo-domain.net"]>: missing or malformed local part
如果我注释掉该from
字段,则邮件可以正常发送,但缺少发件人信息(显然)。
关于我做错了什么的任何想法?
谢谢。
编辑:我正在使用 Rails 2.3.2 和 Ruby 1.9.1