System.Web.Mail.MailMessage.headers

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.
 
J

Jacky Kwok

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.
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top