发送带有ruby的电子邮件,其中地址具有gmail样式'+'过滤器

时间:2009-12-22 20:43:03

标签: ruby-on-rails ruby email smtp

当我尝试发送电子邮件时说me+test@gmail.com它会抛出(Net::SMTPSyntaxError) "501 5.1.3 Bad recipient address syntax"是我还是语法检查器有点过于严格?

有没有人遇到过这个/有一个net / smtp补丁?

回溯:

/usr/local/lib/ruby/1.8/net/smtp.rb:679:in `check_response'
/usr/local/lib/ruby/1.8/net/smtp.rb:652:in `getok'
/usr/local/lib/ruby/1.8/net/smtp.rb:634:in `rcptto'
/usr/local/lib/ruby/1.8/net/smtp.rb:545:in `send0'
/usr/local/lib/ruby/1.8/net/smtp.rb:544:in `each'
/usr/local/lib/ruby/1.8/net/smtp.rb:544:in `send0'
/usr/local/lib/ruby/1.8/net/smtp.rb:471:in `sendmail'
/usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/base.rb:684:in `perform_delivery_smtp'
/usr/local/lib/ruby/1.8/net/smtp.rb:378:in `start'
/usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/base.rb:682:in `perform_delivery_smtp'
/usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/base.rb:523:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/base.rb:523:in `deliver!'

2 个答案:

答案 0 :(得分:0)

非常快速的思考(没有研究,如果我错过了这个标记就这么道歉!):试试地址'me+test@gmail.com'周围的单引号,使其成为文字字符串?

否则,这篇文章似乎解决了the problem with Exception Notifier Plugin and Rails 2.2.2+

答案 1 :(得分:0)

问题出在上游 - 使用sendgrid。

你确定它来自ruby而不是来自smtp服务器吗? - flyfishr64