troubleshooting Question

VB.Net Save HTML Mail Message to TXT or RTF File Format

Avatar of JB4375
JB4375Flag for United States of America asked on
OutlookVisual Basic.NET
6 Comments2 Solutions2066 ViewsLast Modified:
I have a simple subroutine that takes data pulled from a web form and submits an email request.

Ultimately, rather that sending the email I want it to save the email as an RTF file that retains the formatting.

If this isn't possible could someone give me a simple example of how to create the RTF with the same parts of the email? Code below.

Thanks,

JB


    Public Sub Send_Email()
        Dim Mail As New MailMessage()
        Dim mailBody As String

        Mail.From = New MailAddress("netadmin@domain.com")
        Mail.To.Add(strUser & "@domain.com")
        Mail.Subject = "Issue with Request Form"
        mailBody = "The following issue: " & DropDownList1.SelectedItem.Text & " has been reported by " & strUser & "." & "<br/>" & "<br/>"
        mailBody &= "Problem Description: " & TextBox5.Text & "<br/>" & "<br/>"
        mailBody &= "Thank you," & "<br/>" & "<br/>"
        mailBody &= "Information Services" & "<br/>"
        Mail.Body = mailBody
        Mail.Priority = MailPriority.High ' Normal, Low or High
        Mail.IsBodyHtml = True

        Dim smtp As New SmtpClient("mail.domain.com")
        Try
            smtp.Send(Mail)
        Catch ex As Exception
            MsgBox(Err.Description & vbCrLf & ex.ToString)
            Exit Sub
        End Try
    End Sub
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros