You can use Sender property of the MailMessage class to set the ReversePath as aspnetmail. for example:
MailMessage msg = new MailMessage(); msg.Sender = "sender@gmail.com"; msg.From = from@gmail.com"; msg.To = recipient@gmail.com; Moreover, the MailMessage also provides more support for email header. You can feel free to add any custom mail header like
MailMessage msg = new MailMessage(); msg.From = "from@gmail.com"; msg.To = "recipeint@gmail.com"; msg.Headers["return-path"] = new MimeHeader("return-path", sender@gmail.com);
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.