rails - email name + address,
访问量: 690
refer to: https://stackoverflow.com/questions/957422/rails-actionmailer-format-sender-and-recipient-name-email-address
require 'mail' address = Mail::Address.new email # ex: "[email protected]" address.display_name = name.dup # ex: "John Doe" # Set the From or Reply-To header to the following: address.format # returns "John Doe <[email protected]>"