mail-gem

Net::SMTPSyntaxError: 501 Invalid RCPT TO address provided

可紊 提交于 2020-12-09 05:54:17
问题 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: Try adding # encoding: utf-8 to the

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: Try adding # encoding: utf-8 to the

How to retrieve only unread emails with ruby mail gem?

落爺英雄遲暮 提交于 2019-12-23 12:27:33
问题 I am trying to retrieve emails with ruby mail gem, in the examples it says that Mail.last will retrieve the last unread email https://github.com/mikel/mail#getting-emails-from-a-pop-server but it returns just the last email no matter whether it has been read before or not. Does anybody know how to get only unread emails? 回答1: This question was answered in Need help on reading emails with "mail" gem in ruby However the answer was not accepted - don´t know why. Also the question did not mention

Mail Gem: Render received email in browser / Full parse of html parts

十年热恋 提交于 2019-12-11 23:23:25
问题 I am working with the Mail Gem to receive emails in my Rails 4 application. The mails are grabbed via POP from a mailbox, every 10 minutes or so, via the Gem. I need to render these emails - mostly in HTML format - and am having trouble saving the body in HTML, not to mention working with things like embedded images. I'm probably missing something here- looked all over StackOverflow but haven't seen an answer to related questions yet. I have been working with message.body.decoded and also