473,651 Members | 2,485 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combining message.BodyFor mat = MailFormat.Html & message.BodyFor mat = MailFormat.Text

mg
I'd like to send a single e-mail message message that uses the escape character \n as well as the html tag <i> in the body

How can I combine the two parts of this merssage

message.BodyFor mat = MailFormat.Text
String msgTextA = "\n\nFrom: Carol Johnson\n\nSent : Monday, February 9, 2004

message.BodyFor mat = MailFormat.Html
String msgTextB = "<i> Inventory Control <i>

????? message.Body = msgText; ??????

SmtpMail.Send(m essage);
Nov 18 '05 #1
1 6339
Hi,
The System.Web.Mail part does not support sending more than one body
format for an email message.
You can use either MailFormat.Text or MailFormat.Html .
I think in your case if you just want to have line breaks,you can use
MailFormat.Html for your whole email body.
message.BodyFor mat = MailFormat.Html ;
String msgTextA = "<br><br>Fr om: Carol Johnson<br><br> Sent: Monday,
February 9, 2004" ;// to convert to html way

Unfortunately the System.Web.Mail class does not allow you
to send an HTML message with support for non
HTML readers.
If you really want to support non HTML readers you will
need to look for some third party.
Here is a link :
http://www.quiksoft.com/newsletter/i...ult.asp?page=1
Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com


"mg" <mg@theworld.co m> wrote in message
news:15******** *************** ***********@mic rosoft.com...
I'd like to send a single e-mail message message that uses the escape character \n as well as the html tag <i> in the body.
How can I combine the two parts of this merssage?

message.BodyFor mat = MailFormat.Text ;
String msgTextA = "\n\nFrom: Carol Johnson\n\nSent : Monday, February 9, 2004"
message.BodyFor mat = MailFormat.Html ;
String msgTextB = "<i> Inventory Control <i>"

????? message.Body = msgText; ??????

SmtpMail.Send(m essage);

Nov 18 '05 #2

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

Similar topics

1
330
by: | last post by:
Hi, I am getting an exception thrown when i am trying to send mail using the following code Dim msg As MailMessage = New MailMessage() msg.From = Forum + " <" + forum@developer-source.co.uk + ">" msg.To = TestUser+ " <" + neil_stevens@blueyonder.co.uk + ">"
0
2186
by: David Dvali | last post by:
Hello. I have a problem with sending Unicode text in mail message. So what I do: First of all I have some template file like this: ================================= <html> <head><title>Test Message</title></head> <body> <p>Hello {0}</p>
5
2319
by: Yossi Naggar | last post by:
Hello to everyone, Does anybody know how to send html formatted messages with asp.net? I tried to send such messages with the code below but the content type is wrong. The content type is multi-part and not html/text as expected. The code i use is: mailmsg.To = "XXX@XXXX.com" mailmsg.Subject = "some subject string" mailmsg.Body = <-- an html format body --> mailmsg.From = "XXX@XXXX.com"
1
2429
by: Michael | last post by:
Hello, I've read a lot of threads on this subject, but they typically go back to a problem with the smtp server configuration. In my case, everything works great until I uncomment the one line below. Once I set the BodyFormat to MailFormat.Html then I get: HttpException (0x80004005): Could not access 'CDO.Message' object Otherwise, everything works fine and I get my html tags in plain text. I've got it working (in plain text) with my...
2
372
by: MattB | last post by:
I've taken some working code from a vb clas library that was a part of a web application and put it into a stand alone class library so I can reuse it from other applications. I'm using some code (pasted below) to send email that uses the mail.mailmessage object. It compiles ok, and debugs ok until the mail is supposed to be sent and it throws an exception, whitht e message: "Could not access 'CDO.Message' object.". Can anyone suggest...
1
6074
by: Andre | last post by:
Hi folks, I'm trying to create a sub that e-mails the results of program output to our accounts receivable manager. I built my CDO code using examples from a couple newsgroups like this one, so I didn't see any examples of how the message body is coded. I wrote the CDO mailer as shown below, the output is all there but the carriage returns don't carry into the e-mail message, the message body appears as one line. Is the sample below...
3
2576
by: Anthony Fine | last post by:
Hello All, I have a VB.Net app that needs to send mail. I have created a class for building my e-mail, but keep getting the error (Could not access 'CDO.Message' object.) when trying to send it. I can successfully send an e-mail when I use the CreateObject("CDO.Message") method, but it fails when trying to send using VB.Net. My code is below, I have included three different ways that I have tried it, and both VB.Net options fail, any...
4
2036
by: dancer | last post by:
I get this error if an item in a radiobutton list is not chosen when filling in a form.. I added a RequiredFieldValidator, but I still get the message. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details:...
3
2246
by: dancer | last post by:
I am using Framework 1.1.4322. Who can tell me why I'm getting this error? My code follows Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30456: 'Text' is not a member of 'System.Web.UI.WebControls.CheckBoxList'.
0
8275
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,...
0
8802
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8465
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
8579
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...
0
7297
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
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
5612
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2699
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
1587
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.