System.Web.Mail.MailMessage.headers

  • Thread starter Thread starter stuart
  • Start date Start date
S

stuart

Hi,

Can anybody tell me if it is possible to add your own headers through this
class.
The documenttion seems to be a bit ambiguous, for example the overview of
the methods says

Specifies the custom headers that are transmitted with the e-mail message.

but the property is read only

[Visual Basic]
Public ReadOnly Property Headers As IDictionary

I wish to change the headers to specify a html part and a plain text part,
The headers I wish to add/change are
Content-Type: multipart/alternative;

boundary="----=_NextPart_000_0005_01C3A604.321346F0"


cheers

martin.
 
stuart said:
Hi,

Can anybody tell me if it is possible to add your own headers through this
class.
The documenttion seems to be a bit ambiguous, for example the overview of
the methods says

Specifies the custom headers that are transmitted with the e-mail message.

but the property is read only

[Visual Basic]
Public ReadOnly Property Headers As IDictionary

I wish to change the headers to specify a html part and a plain text part,
The headers I wish to add/change are
Content-Type: multipart/alternative;

boundary="----=_NextPart_000_0005_01C3A604.321346F0"


cheers

martin.

You can add your header.

e.g. C# code
message.Headers.Add("Content-Transfer-Encoding","base64");


////
The "Headers" is ReadOnly means that you cannot assign a new "Headers"
colloection object to it. However, you can add values to the existing
header collection.
 
Back
Top