我的代码: -
from = @site.name + ", <no-reply@" + @site.url + ">"
mail(:from => from , :to => @recipient.email, :subject => "Invitation mail")
错误是: -
Net::SMTPSyntaxError (501 5.1.7 Bad sender address syntax
):
答案 0 :(得分:2)
删除@site.name
与<
括号之间的逗号。你正试图这样做:
My Name, <no-reply@mysite.com>
应该是:
My Name <no-reply@mysite.com>