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?

有帮助吗?

解决方案

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

其他提示

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top