Net::SMTPSyntaxError: 501 Invalid RCPT TO address provided

試著忘記壹切 提交于 2020-12-09 05:54:02

问题


As I understood I have issue because use not ASCII symbols in emails address

Example:

Notifier.rb

mail(to: "Tamón ÄRUÄ <example@example.com>", subject: "Email subject")

Any advice how I can handle this case? I prefer keep user name in address.


回答1:


According to ActionMailer documentation multibyte encoding should be done automatically: http://guides.rubyonrails.org/action_mailer_basics.html#auto-encoding-header-values

There might be several things to try:

  1. Try adding # encoding: utf-8 to the first line of your controller;
  2. Try using mail.transport_encoding = '8bit' http://www.rubydoc.info/github/mikel/mail/Mail%2FMessage%3Atransport_encoding


来源:https://stackoverflow.com/questions/32349652/netsmtpsyntaxerror-501-invalid-rcpt-to-address-provided

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!