How can i add a a different email then the sender in the ReplayTo
field ?
Seems MailMessage.ReplyTo
is deprecated so I'm trying to use ReplyToList
instead.
But it's telling me that
Property or indexer 'System.Net.Mail.MailMessage.ReplyToList' cannot be assigned to -- it is read only
Here is my code so far:
var reply = new MailAddressCollection();
reply.Add("[email protected]");
MailMessage mail = new MailMessage(senderEmail,usr.Email,"subject","message");
mail.ReplyToList = reply;
var smtp = new SmtpClient();
smtp.Send(mail);