Im using the SendGrid API in my Windows Azure environment to send emails. I have a need to alter the email priority (Low\High Importance) of some emails, but I don't see any properties that allow me to do this.
Does anyone have experience with SendGrid who knows how to change the priority? There is a property that allows me to add headers.. so Im not sure if that's something I can use to do this?
Thanks in advance!
I was also looking for a way to mark email as important. After going through a couple of articles, I found the answer over here- https://github.com/sendgrid/sendgrid-csharp/issues/251
All you need to do is add priority in your mail headers. Like this-
mailMessage.Headers.Add("Priority", "Urgent");
mailMessage.Headers.Add("Importance", "high");
Code above works for high priority. I am guessing you would have to do something similar for low priority emails. Hope this helps.
If you are using the Web API you can use the headers parameter as you mention. If sending via SMTP you can just add the headers to your message.
There are a few headers defined in RFC 4021 that support this as well as some custom ones. I'd use the following JSON for the headers parameter to start:
{“Priority”: “Urgent”, “Importance”: “high”}
If that doesn't work you can also look into the X-Priority
and X-MSMail-Priority
headers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With