I've written code in C# that send mail to number of users. The email is in HTML format and contains a unsubscribe link.
What I want to do is, have unsubscribe link as shown in image...
To add more information, I'm using SendGrid for sending emails to end users.
I viewed raw message format in Gmail and I can see Header there in format
List-unsubscribe: <https..../usersettings?SubscriberId=VioR5IcgvSIosfB1w%2FCPfhpyGBdko%2BxsmFTAsQAemuWgSJkpTP1UeDg%2BW4frl59A0KVVpiK0lI7IrS3N1BCm0Sspd0dqEaJGlKHAY3g7IR3INwkyJEAmfU55TBJ8uEo%3D>
Yet the link is not displayed. What am I missing?
You have to add that link in your email header something like this
mailMessage.Headers.Add("List-Unsubscribe", String.Format(
CultureInfo.InvariantCulture, "<http://{0}>", unSubscribeUrl));
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