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 <sender@example.com>', 
      to: 'Receiver Name <receiver@example.com>', 
      subject: 'Subject'
    )
    

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