HtmlTextWriter Email Usage?

L

Leon

Is the following a cool way to write to write a pre-built html formatted
email message to be call from within a class to a weform on button-click
event?

Please voice your opion. Thanks!
Protected Sub SendEmail(ByVal Message As String)

Dim swHtmlBody As New StringWriter

Dim swTextWriter As New HtmlTextWriter(swHtmlBody)

With swTextWriter

..RenderBeginTag("html")

..RenderBeginTag("head")

..RenderBeginTag("title")

..WriteLine("Your Lost Password")

..RenderEndTag()

..RenderEndTag()

..RenderBeginTag("body")

..WriteLine("Hi ", FirstName, " ", LastName, ",")

..WriteLine()

..Write("Your Registered:")

..WriteLine("Email -", EmailAddress)

..WriteLine("Password -", Password)

..RenderEndTag()

..RenderEndTag()

End With

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top