473,320 Members | 2,048 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,320 software developers and data experts.

problem with sending formatted email

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.BodyFormat = MailFormat.Html;
mailMsg.Body = txtRichTextBox.txt; * where the value of the txtRichTextBox.txt is text with formatted.
mailMsg.Priority = MailPriority.High;
..................




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 1074
mzmishra
390 Expert 256MB
can you check what is the value of txtRichTextBox.txt ,when you are sending the email.
Dec 3 '07 #2
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 Expert 256MB
Try using Server.HtmlEncode(TextBox1.Text)
Dec 3 '07 #4
Try using Server.HtmlEncode(TextBox1.Text)
it hit errors.
do have any properties or any class can convert the formatted text into html?
Dec 3 '07 #5
mzmishra
390 Expert 256MB
what errors u r getting?
Dec 3 '07 #6
what errors u r getting?
The type or namespace name 'HtmlEncode' does not exist in the namespace 'Microsoft.SqlServer.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.server namespace.
Dec 3 '07 #7
mzmishra
390 Expert 256MB
Hmm.

Ok try like this
HttpContext.Current.Server.HtmlEncode
Dec 3 '07 #8
Hmm.

Ok try like this
HttpContext.Current.Server.HtmlEncode

i have really no idea about this.
it prompt "'System.Web.HttpContext.Current' 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
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 : ...
3
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....
4
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...
5
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...
2
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...
3
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...
2
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. ...
4
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 ...
1
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.