473,785 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.He aders. 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 3499
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.co m

<as*******@gmai l.com> wrote in message
news:11******** *************@g 47g2000cwa.goog legroups.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.He aders. 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
8675
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. Consider the following three snippets of C# code:
3
1624
by: Bart Stes | last post by:
Hey guys, I'm try to write a very simple winform app that allows the users to send an email. I use the System.Web.Mail MailMessage class for this. But when it comes to adding an attachment, something appears to go wrong. After I execute the following code, the MailMessage appears to have an attachment (looked it up through a watch in debug mode), but when I actually send the message, the attachment is not send along with it. So the...
5
2237
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 that I may have to use some sort of third
1
6839
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 header fields as properties (eg: FROM, TO, CC) and these are not sufficient.
34
18271
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow "127.0.0.1". 4. Authentication: "Anonymous access" only. 5. Outbound connection listen to TCP 25. Besides,
1
4185
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 computer in located behind a firewall and I'm sending test emails to my gmail account and hotmail...
2
17489
by: clevrmnkey | last post by:
I've had nothing but trouble from the System.Net.Mail objects, but I finally need to make them work, and I can't for the life of me see what I'm doing wrong. I pared back my mail transaction to the bare minimum: System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("<my mail server IP>", 25); smtp.Send("<one of my email addresses>", "<another of my email addresses>", "Hello", "World");
2
2808
by: joseph2000 | last post by:
Hi, I have problem with e-mails which are being send via System.Web.Mail.SmtpMail class but before describing the problem itself first I'd like to show shortly what I'm doing on the server. The following code is being executed on the server to send e-mails to clients (.NET Framework 1.1): .... EmailsInQueCollection eqc = GetUnsentEmails();
4
2399
by: David C | last post by:
I would like to have an email go to 2 email addresses but when I try it by separating with semicolon or comma it fails. Can anyone help? below is my code (see ToAddress string). Thanks. David strUser = UtilClass.GetUserName(strUser) '!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS Const ToAddress As String = "me@myemail.com" Const FromAddress As String = "me@myemail.com"
4
6621
by: dragon52 | last post by:
Hi there, I am writing php to send email containing Chinese text. The chinese displays correctly depending on different mail servers, it seems. I can read the chinese text if I open the email using webmail on my telco's website (Telstra's Bigpond in Australia) or Yahoo mail. If I look at the same email using MS Outlook then the chinese text is just rubbish. So I experimented and wrote (VS2008) the code using the Smtp.Client (Microsoft...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10091
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.