Question

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?

Was it helpful?

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

OTHER TIPS

This work for me(Rails):

default(

   from: "SenderName <hola@udocz.com>",
   reply_to: "SenderName <hola@udocz.com>"

)

def send_mail(email, subject)

   #body = ......

   mail(to: email, subject: subject, body: body, content_type: "text/html")

end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top