How do I add the Reply-To header to the MailMessage?
To add the Reply-To header to an email, you need to use the MailMessage.Headers property. For example:
[ C# ]
[ VB.NET ]
mail.Headers.Add( "Reply-To", "alternate_email@mycompany.com")The following code snippet demonstrates this technique.
[ C# ]
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "you@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "this is my test email body.";
mail.Headers.Add( "Reply-To", "alternate_email@mycompany.com" );
SmtpMail.SmtpServer = "localhost"; //your real server goes here
SmtpMail.Send( mail );
[ VB.NET ]
Dim mail As New MailMessage()
mail.To = "me@mycompany.com"
mail.From = "you@yourcompany.com"
mail.Subject = "this is a test email."
mail.Body = "this is my test email body."
mail.Headers.Add("Reply-To", "alternate_email@mycompany.com")
SmtpMail.SmtpServer = "localhost" 'your real server goes here
SmtpMail.Send(mail)
From www.systemwebmail.com FAQ
3 nhận xét:
Read all the information that i've given in above article. It'll give u the whole idea about it.
AWS training in chennai
AWS Training in Bangalore
Thanks for sharing your valuable post and keep doing Looking towards more
To Enhance and Explore the Technical Knowledge's Learn Python
python training in chennai | python training in annanagar | python training in omr | python training in porur | python training in tambaram | python training in velachery
Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us
and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
Java training in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Online Training
Post a Comment