0

I am trying to send an email message in HTML Format. I have a richtextbox the the user can change the color and font in the message. Below is the code I am using which ends up send in Text Format. Most codes I have found use System.WebMail which in vb 2008 is obsolete. This snippet is using System.Net.Mail namespace.

Public Shared Function SendEmailMessage(ByVal sendTo As String, _
                                 ByVal sendFrom As String, _
                                 ByVal sendSubject As String, _
                                 ByVal sendMessage As String, _
                                 Optional ByVal toBcc As ArrayList = Nothing, _
                                 Optional ByVal attachments As ArrayList = Nothing) As String
Dim message As New MailMessage()
                With message
                    .From = New MailAddress(sendFrom)
                    .To.Add(sendTo)
                    .Subject = sendSubject
                    .IsBodyHtml = True
                    .Body = sendMessage
                End With

Thanks
Charles

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by sbanks_charles
0

Thanks for the reply.
I saw this article. It is written in C# (which I know how to convert) but also very cufusing. In the end, with this take the RTF format from a richtextbox and convert it?

>Sending HTML Msg. using system.net.mail

HTML mail message requires Mime type (text/html). Take a look at this MSDN article.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.