문제

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