473,587 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Web.Mail .MailMessage.he aders

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.3 21346F0"
cheers

martin.

Nov 17 '05 #1
1 3640
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.3 21346F0"
cheers

martin.


You can add your header.

e.g. C# code
message.Headers .Add("Content-Transfer-Encoding","base 64");
////
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.cu hk.edu.hk
ja***@compose.c om.hk

Nov 17 '05 #2

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

Similar topics

4
8658
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 spreadsheet attachment per message, seems to be causing som kind of corruption of the attachment, while several spreadsheets per works just fine....
20
3008
by: Adrian | last post by:
What does this error mean? Could not access CDO Message Object. Many thanks.
3
3258
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 = "W-MyPcName.mycompany.com"; mail.To=strTo; mail.Cc=strCC; mail.Bcc=strBCC;
5
2227
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 this class that will send email, however my class will not seem to recognise the system.web.mail.mailmessage. my first impression on this is...
0
1267
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, System.Web.Mail.MailFormat Format) { bool bReturn = false;
0
1221
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>) myMail.Headers.Add("Disposition-Notification-To", <address@mail.com>) The header "Disposition-Notification-To" run, not "Return-Receipt-To".
1
3493
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? I was thinking adding custom properties to System.Net.Mail.MailMessage.Headers. but it's a READONLY property. System.Net.Mail.MailMessage has few...
1
8168
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 the members of my organization. I think my problem is incorrectly setting the settings on my server or an authentication problem. Here is the code I...
1
4175
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 minutes before an email is sent (this is on my local computer point to my local smtp -> localhost). Anyone knows what the problem could be? BTW my...
8
5186
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 an email received by their system. That's not the odd part. The oddity is they want to have a single X-Header containing multiple keys and...
0
7843
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8205
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.