Read a Web Page and send it as an HTML Email
Recently I was asked to write a code to send entire Aspx page as an HTML mail using VB.Net.
Private Function ReadAspxPage(ByVal url As String) As String
Dim htmlPage As String
Dim objResponse As System.Net.WebResponse
Dim objRequest As System.Net.WebRequest = System.Net.HttpWebRequest.Create(url)
objResponse = objRequest.GetResponse()
Dim readpage As New System.IO.StreamReader(objResponse.GetResponseStream())
htmlPage = readpage.ReadToEnd()
readpage.Close()
Return htmlPage.toString()
End Function
Share and Enjoy:













