【发布时间】:2015-09-10 15:00:02
【问题描述】:
我正在使用 Rails + Mandrill(通过 SMTP)发送电子邮件。
这些电子邮件是从foo@example.com 发送的,但我希望用户在接收邮件时看到一个像John Doe 这样的好名字,而不是电子邮件地址。这可以通过rails实现吗?
【问题讨论】:
标签: ruby-on-rails-4 actionmailer mandrill
我正在使用 Rails + Mandrill(通过 SMTP)发送电子邮件。
这些电子邮件是从foo@example.com 发送的,但我希望用户在接收邮件时看到一个像John Doe 这样的好名字,而不是电子邮件地址。这可以通过rails实现吗?
【问题讨论】:
标签: ruby-on-rails-4 actionmailer mandrill
在你的 Mailer 类中放一些类似
default from: 'John Doe <foo@example.com>'
例如
class MyMailer < ApplicationMailer
default from: 'John Doe <foo@example.com>'
def example_mail
...
end
end
【讨论】: