Sendgrid-csharp: How do i set the Sender of an email (not the From)?

Created on 7 Jun 2019  路  4Comments  路  Source: sendgrid/sendgrid-csharp

when using the C# client, how do I set the Sender of an email (not the From). I thought in the past i had asked this and was told to just add a "Sender" header, but that doesnt seem to work. it gets ignored.

Technical details:

  • sendgrid-csharp Version: 9.11.0
  • Platform (WebForms, ASP.NET, ASP.NET Core, etc.)
  • .NET Version: 4.7.2
unknown or a waiting for feedback question

Most helpful comment

correct. that is what i tried before but it seems to be ignored.

I just got this below from SendGrid support which is not good news. If that is true, that presents a problem for us in our one scenerio that needs it. I could have sworn I was able to set the sender path a long time ago, so i wonder if that aspect changed over time? have you heard of this limitation with SendGrid not support setting the Sender? maybe that is why it's not a top level property on the message object for this c# client?

Hi there,
Thanks for reaching out to SendGrid Support, and I apologize that we missed your chat.
I apologize for any inconvenience, but you will not be able to set the Sender Address on your end. SendGrid utilizes the Return Path as the Sender Address which allows us to collect data surrounding the activity of your mail sends: spam reports, bounces, blocks, etc.
Let us know if you have any other questions or concerns.
Best,
Cody B. | Associate Support Engineer

All 4 comments

Hello @kquinbar,

Is this something like what you tried?

msg.AddHeader("Sender", "Michael Jones <[email protected]>");

With Best Regards,

Elmer

correct. that is what i tried before but it seems to be ignored.

I just got this below from SendGrid support which is not good news. If that is true, that presents a problem for us in our one scenerio that needs it. I could have sworn I was able to set the sender path a long time ago, so i wonder if that aspect changed over time? have you heard of this limitation with SendGrid not support setting the Sender? maybe that is why it's not a top level property on the message object for this c# client?

Hi there,
Thanks for reaching out to SendGrid Support, and I apologize that we missed your chat.
I apologize for any inconvenience, but you will not be able to set the Sender Address on your end. SendGrid utilizes the Return Path as the Sender Address which allows us to collect data surrounding the activity of your mail sends: spam reports, bounces, blocks, etc.
Let us know if you have any other questions or concerns.
Best,
Cody B. | Associate Support Engineer

Hello @kquinbar,

Thank you for posting your findings here! That makes sense.

No, I had not ran across this use case yet, that I can remember.

Hello @kquinbar,

I'm closing this one out because it is not an issue we can resolve via this helper library and it appears that the feature you are requesting is not possible due to limitations around data collection.

Please do re-open or create a new issue if you require further assistance.

With best regards,

Elmer

Was this page helpful?
0 / 5 - 0 ratings