Adding custom Mail header to System.Net.Mail.MailMessage

  • Thread starter Thread starter asnowfall
  • Start date Start date
A

asnowfall

I am creating MailMessage out of already existing email message.
My existing message has few custom properties. I wan to add them to
System.Net.Mail.MailMessage

How to add custom properties?

I was thinking adding custom properties to
System.Net.Mail.MailMessage.Headers. but it's a READONLY property.
System.Net.Mail.MailMessage has few header fields as properties (eg:
FROM, TO, CC) and these are not sufficient.

So, if I have to use System.Net.Mail.MailMessage, do I have to ignore
the custom header properties?

Thanks
Ramesh
 
Ramesh,

Did you try adding something to these headers? The Headers property is
read only, but that onlyh means that you can't swap out the collection
outright. You should still be able to add whatever headers you wish.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top