RichTextBox- RTF -Send by Email

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi all,
Ive researched a lot but cant find a solution.  I have text in a RichTextBox with RTF format (with an image) that I need to send by email (all in VB.NET 2005).
 
The code to send email has:
... <font size=2>
</font><font color="#0000ff" size=2>With</font><font size=2> MailMsg
.From = </font><font color="#0000ff" size=2>New</font><font size=2> MailAddress("</font><font color="#a31515" size=2><a title="mailto:abc@abc.ab mailto:abc@abc.ab abc@abc.ab </font><font size=2>")
.BodyEncoding = System.Text.Encoding.Default
.Subject = strSubject.Trim()
.Body = strMessage.Trim() & vbCrLf
.Priority = MailPriority.High
.IsBodyHtml = </font><font color="#0000ff" size=2>True </font><font size=2>
</font><font color="#0000ff" size=2>End</font><font size=2> </font><font color="#0000ff" size=2>With
... <font size=2>
</font><font color="#0000ff" size=2>Dim</font><font size=2> SmtpMail </font><font color="#0000ff" size=2>As</font><font size=2> </font><font color="#0000ff" size=2>New</font><font size=2> SmtpClient
SmtpMail.Host = strHost
</font><font color="#008000" size=2>SmtpMail.Credentials = theCredential </font><font size=2>
SmtpMail.Send(MailMsg)
 
<font color="#000000 and it actually sends the email but the body of the mail shows RTF garbage like:</font>
{rtf1ansiansicpg1252deff0deflang1033deflangfe1033{fonttbl{f0fnilfcharset0 Microsoft Sans Serif;}{f1fromanfprq2fcharset0 Times New Roman;}} {colortbl ;red0green128blue0;} viewkind4uc1pardnowidctlparf0fs17</font></font>
 
Is there any way I can send the .rtf content of the richtextobox via email without using a third-party component nor Word?  If I need to use Word, is there any URL that shows how to do this?
 
Thanks very much for your time,
ST

View the full article
 
Back
Top