473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

System.Web.Mail.MailMessage.headers

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.

Nov 17 '05 #1
1 3631
stuart wrote:
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.
--
Jacky Kwok
ja***@alumni.cuhk.edu.hk
ja***@compose.com.hk

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Trond A. S. Andersen | last post by:
Hi, all! I'm trying to use the System.Web.Mail. "package" combinded with System.Web.Mail.SmtpMail in order to send MS Excel spreadsheets attached to mail messages. However, sending one single...
20
by: Adrian | last post by:
What does this error mean? Could not access CDO Message Object. Many thanks.
3
by: Phil Mc | last post by:
Hi has anyone come accross the problem.... with referance to System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail THIS WORKS FINE mail=new MailMessage(); mail.From =...
5
by: martin | last post by:
Hi, I have created a class that is totally seperate from my web application. However this class is used extensivly by the web application for stuff like data access. I wish to add a function to...
0
by: gh0st54 | last post by:
Hi i'm looking for how to change the date of out going messages i tried this but it doesn't seems to work static public bool SendEmail(string To, string From, string Subject, string Body,...
0
by: Dan___ | last post by:
How to send a mailmessage with a return receipt? I use the property Headers of the class MailMessage dim myMail as new MailMessage myMail.Headers.Add("Return-Receipt-To", <address@mail.com>)...
1
by: asnowfall | last post by:
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? ...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
1
by: maflatoun | last post by:
Hi everyone, I'm coverting some of our code here from the old way of send email in ..net 1.1 to the new .net 2.0. However, everyone I switch the code the new method there is a delay of 1-2...
8
by: travispennington | last post by:
To anyone that can assist me: I deeply appreciate your help!! I am developing an application with an outside vendor. The vendor has a very odd requirement. They need custom X-Headers added to...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.