K
kpandian
Hi Everyone,
I am using System.Web.Mail [C#,Windows Form] to send emails. I am
taking the rtf of a rich text box to populate the string for the body
of the email.
-------------------------------------------------------------------------------------------------------------------
// Converting the Rtf of richtextboxcontrol to byte array and then to a
stream
Byte[] byt = System.Text.Encoding.Unicode.GetBytes(richTextBox1.Rtf);
Stream output = new MemoryStream(byt);
// reading the stream and getting the values into a string (to be used
as body for my string)
StreamReader reader = new System.IO.StreamReader(output,
System.Text.Encoding.Unicode);
string theString = reader.ReadToEnd();
reader.Close();
-------------------------------------------------------------------------------------------------------------------
MailMessage objMail = new MailMessage();
objMail.From = "XX";
objMail.To= "YY";
objMail.Cc= "ZZ";
objMail.Priority = System.Web.Mail.MailPriority.High;
objMail.Subject="Email Template";
objMail.BodyFormat = MailFormat.HTML;
objMail.BodyEncoding = System.Text.Encoding.ASCII;
//using the string I got earlier
objMail.Body = theString;
SmtpMail.SmtpServer ="XXXX"; //Give ur mail servers IP address here
SmtpMail.Send(objMail);
------------------------------------------------------------------------------------------------------------------
All my clients have Outlook 2003. They get the string as
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0
Arial;}{\f1\froman\fprq2\fcharset0 Times New
Roman;}{\f2\fswiss\fprq2\fcharset0 Century
Gothic;}{\f3\fswiss\fcharset0 Arial;}{\f4\fnil\fcharset2 Symbol;}}
{\colortbl
;\red0\green0\blue0;\red255\green0\blue0;\red0\green0\blue255;}
\viewkind4\uc1\pard\cf1
I did a lot of search but could not find the slution yet. Does anyone
had any problems like this before. Any help would be appreciated.
Thanks,
Karthik Pandian
I am using System.Web.Mail [C#,Windows Form] to send emails. I am
taking the rtf of a rich text box to populate the string for the body
of the email.
-------------------------------------------------------------------------------------------------------------------
// Converting the Rtf of richtextboxcontrol to byte array and then to a
stream
Byte[] byt = System.Text.Encoding.Unicode.GetBytes(richTextBox1.Rtf);
Stream output = new MemoryStream(byt);
// reading the stream and getting the values into a string (to be used
as body for my string)
StreamReader reader = new System.IO.StreamReader(output,
System.Text.Encoding.Unicode);
string theString = reader.ReadToEnd();
reader.Close();
-------------------------------------------------------------------------------------------------------------------
MailMessage objMail = new MailMessage();
objMail.From = "XX";
objMail.To= "YY";
objMail.Cc= "ZZ";
objMail.Priority = System.Web.Mail.MailPriority.High;
objMail.Subject="Email Template";
objMail.BodyFormat = MailFormat.HTML;
objMail.BodyEncoding = System.Text.Encoding.ASCII;
//using the string I got earlier
objMail.Body = theString;
SmtpMail.SmtpServer ="XXXX"; //Give ur mail servers IP address here
SmtpMail.Send(objMail);
------------------------------------------------------------------------------------------------------------------
All my clients have Outlook 2003. They get the string as
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0
Arial;}{\f1\froman\fprq2\fcharset0 Times New
Roman;}{\f2\fswiss\fprq2\fcharset0 Century
Gothic;}{\f3\fswiss\fcharset0 Arial;}{\f4\fnil\fcharset2 Symbol;}}
{\colortbl
;\red0\green0\blue0;\red255\green0\blue0;\red0\green0\blue255;}
\viewkind4\uc1\pard\cf1
I did a lot of search but could not find the slution yet. Does anyone
had any problems like this before. Any help would be appreciated.
Thanks,
Karthik Pandian