Pavel Tarno
Pavel Tarno

Reputation: 1324

Rails email name label

I'm using Rails + Mandrill (via SMTP) to send emails.
The emails are sent from [email protected] but I want users to see a nice name like John Doe instead of the email address when receiving the mail. Can this be achieved through rails?

Upvotes: 1

Views: 237

Answers (1)

Nikita Misharin
Nikita Misharin

Reputation: 2020

In your Mailer class put something like

default from: 'John Doe <[email protected]>'

For example

class MyMailer < ApplicationMailer
  default from: 'John Doe <[email protected]>'

  def example_mail
    ...
  end
end

Upvotes: 2

Related Questions