rails - email name + address,

访问量: 159

refer to: https://stackoverflow.com/questions/957422/rails-actionmailer-format-sender-and-recipient-name-email-address

require 'mail'
address = Mail::Address.new email # ex: "john@example.com"
address.display_name = name.dup   # ex: "John Doe"
# Set the From or Reply-To header to the following:
address.format # returns "John Doe <john@example.com>"

订阅/RSS Feed

Subscribe