Search code examples
ruby-on-railsruby-on-rails-4mandrill

How can we set the name of the email sender in Rails Mailer?


Whenever I send an email through my Rails app, in my inbox, the name of the sender is shown as "admin".. The email is admin@... The first part of the domain is shown. Im using Mandrill to send the email. How can I change this name?


Solution

  • If you're using ActionMailer, try below

    mail(
      from: 'Sender Name <[email protected]>', 
      to: 'Receiver Name <[email protected]>', 
      subject: 'Subject'
    )
    

    If you're using the Mandrill API, you can explicitly set the sender name API call payload