471,603 Members | 1,439 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

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

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

Jan 13 '06 #1
1 3391
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<as*******@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
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

Jan 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Trond A. S. Andersen | last post: by
3 posts views Thread by Bart Stes | last post: by
5 posts views Thread by martin | last post: by
34 posts views Thread by antonyliu2002 | last post: by
1 post views Thread by maflatoun | last post: by
2 posts views Thread by joseph2000 | last post: by
4 posts views Thread by David C | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.