473,789 Members | 2,561 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with sending formatted email

6 New Member
i'm using System.Web.Mail in my application and i set the BodyFormat = MailFormat.Html ; in MS C#.net



MailMessage mailMsg = new MailMessage();
mailMsg.To = txtTo.Text;
mailMsg.Cc =txtCc.Text;
mailMsg.Bcc = txtBcc.Text;
mailMsg.Subject = txtSubject.Text ;
mailMsg.BodyFor mat = MailFormat.Html ;
mailMsg.Body = txtRichTextBox. txt; * where the value of the txtRichTextBox. txt is text with formatted.
mailMsg.Priorit y = MailPriority.Hi gh;
............... ...




after i send a formatted text, it also display me the plain text.

do i did anything wrong here???


Thanks.
Dec 3 '07 #1
8 1095
mzmishra
390 Recognized Expert Contributor
can you check what is the value of txtRichTextBox. txt ,when you are sending the email.
Dec 3 '07 #2
wengkit
6 New Member
can you check what is the value of txtRichTextBox. txt ,when you are sending the email.


txtRichTextBox. txt is suppose is formatted value in html format eg: <b> BOLD </b>......

i'm facing the problem is, how i going to convert my formatted text into html with tag.

thnaks
Dec 3 '07 #3
mzmishra
390 Recognized Expert Contributor
Try using Server.HtmlEnco de(TextBox1.Tex t)
Dec 3 '07 #4
wengkit
6 New Member
Try using Server.HtmlEnco de(TextBox1.Tex t)
it hit errors.
do have any properties or any class can convert the formatted text into html?
Dec 3 '07 #5
mzmishra
390 Recognized Expert Contributor
what errors u r getting?
Dec 3 '07 #6
wengkit
6 New Member
what errors u r getting?
The type or namespace name 'HtmlEncode' does not exist in the namespace 'Microsoft.SqlS erver.Server' (are you missing an assembly reference?)

this is not related to my application. i'm trying to convert into html but it prompt me the SQLServer.serve r namespace.
Dec 3 '07 #7
mzmishra
390 Recognized Expert Contributor
Hmm.

Ok try like this
HttpContext.Cur rent.Server.Htm lEncode
Dec 3 '07 #8
wengkit
6 New Member
Hmm.

Ok try like this
HttpContext.Cur rent.Server.Htm lEncode

i have really no idea about this.
it prompt "'System.Web.Ht tpContext.Curre nt' is a 'property' but is used like a 'type' "

can u provide me some code example?
thanks
Dec 3 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1711
by: Simon Wigzell | last post by:
I'm generating HTML formatted emails in my asp program using CDONT. Depending on hoow ling the link is it will sometimes wrap and ruin the link. The is Detail email properties listing : ------=_NextPart_000_0314_01C418C2.90C5F130 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit At your request, we have created a webpage message for you: here...
3
4125
by: Andy | last post by:
Hi Aarron Your code below helped me move from CDONTS email to CDOSYS email. My one question is how do I set this CDOSYS email as HTML formatted email. As it is now it just sends straight text. http://www.aspfaq.com/2339 Can you help? Andy
4
2974
by: Francois Keyeux | last post by:
hello everyone: i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50) i know how to create a plain text email by creating a text file, with content following certain format, and saving that file into the correct '..\mailroot\pickup' folder, and it is working fine
5
2636
by: BaWork | last post by:
I have a web form where a client can select which site members to send an email to. This form is populated from the contents of the member table, so the form can have 0-x names listed on it depending on member expiration dates. When the form is submitted, the code loops through the form contents and sends an email to those members that meet the selected criteria. All this worked perfectly when I was sending text emails, but since I
2
1750
by: Paul Turley | last post by:
Does anyone have some sample code for sending an HTML formatted message using CDONTS? Thanks RE: Sending HTML formatted mail using CDONTS -- Paul Turley, MCSD, MCAD, MCT, MSF Practitioner, A+ Technician
3
2227
by: VB Programmer | last post by:
My company has it's own webserver, which is going to host our ASP.NET web application. We want the website to be able to send out emails. 1. What do I need on the server so that it has the abillity to send out emails? It is a Windows 2000 Professional SP3 server. 2. Any examples (code, etc...) on how to send out emails via an ASP.NET webform? Thanks!
2
846
by: Andy_Khosravi | last post by:
I posted this question about two days ago, but for some reason it never actually got put up. I couldn't' find it with searches, so I am re-posting it now. I apologize if this is a double post. Hello, I've a bit of a problem with the SendObject command in VBA. On my computer when I execute the below code, a new memo is generated in Lotus Notes with an attachment labeled "Benefit Issues Log.rtf". (Benefit Issues Log is the name of the...
4
6134
by: k.visube | last post by:
In my ASP application,i need to send a formatted text mail (i.e with newline characters). here in my application i used a function in javascript which construts the mail body sample snippet strbody=strbody +"dear customer,\n"; strbody=strbody +"we are glad to see ur response\n"; strbody=strbody +"we will make the needful thing as early as possible\n";
1
2945
by: robbiesmith79 | last post by:
Just so this is out there on the web, I battled the past 24 hours about this. Background info... I developed a ecommerce website in PHP 4 on a shared linux hosting plan from GoDaddy and had the html formatted emails sending as text/html and were going fine with limited header information. Then we moved the site over to a Dedicated Linux hosting plan. This time, it's PHP 5. Things are bound to not work as expected moving to a new...
0
9663
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
9506
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
10404
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...
0
10193
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10136
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
9979
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
7525
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...
1
4089
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
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.