john smith
john smith

Reputation: 11

asp.net mail message can not do replytolist.add

I have a page in which i am sending out an email blast. The page works and sends out an email. However, when i a try to add email addresses to include as replyto recipients i am getting this error:

'System.Net.Mail.MailMessage' does not contain a definition for 'ReplyToList' and no extension method 'ReplyToList' accepting a first argument of type 'System.Net.Mail.MailMessage' could be found (are you missing a using directive or an assembly reference?)   

i am using this code:

mailMessage.ReplyToList.Add("[email protected]");

this works for mailMessage.CC.Add("[email protected]");mailMessage.bcc.Add("[email protected]"); etc.

Thank you

Upvotes: 0

Views: 978

Answers (1)

SLaks
SLaks

Reputation: 887195

As your compiler is trying to tell you, no such property exists.

If you look in the documentation, you'll see it was added in .Net 4.0.

Earlier versions use the ReplyTo property instead.

Upvotes: 1

Related Questions