-1

I've been trying to set the from name on a Sendgrid e-mail without success. Using nodemailer I could do "Name <name@example.org>" but if I do the same with Sendgrid it produces an error.

I've found an old question with the same issue here (Adding a name to the "from" field in SendGrid in Node.js) and tried the accepted answer but it seems that it is not working anymore.

Is it still possible to do it or are my emails always going to be from donotreply?

Community
  • 1
  • 1

1 Answers1

0

You can set both the "to" and "toname" params on the email when using the library SendGrid provides

This will cause the "To" in the generated email to be of the format Name <name@example.org>

Matt Bernier
  • 94
  • 1
  • 3
  • You're absolutely right. I think that the problem was with Gmail. It received some emails without having fromname set and it wasn't displaying it. – Afonso Garcia Nov 21 '14 at 20:39