Import
System.Net.Mail
Public Sub EmailWebPage()
Dim myMail As New MailMessage()
myMail.From = New MailAddress("From Email Address")
myMail.To.Add("To Email Address")
myMail.Subject = "Email Subject"
Dim htmlPg As String = SendWebPage("http://servername/htmlpage.html")
myMail.Body = htmlPg
myMail.IsBodyHtml = True
Dim smtp As New SmtpClient(<SMTP SERVER>)
smtp.Send(myMail)
End Sub
Public Function SendWebPage(ByVal url As String) As String
Dim objRequest As WebRequest = System.Net.HttpWebRequest.Create(url)
Dim strmRder As New StreamReader(objRequest.GetResponse ().GetResponseStream())
Dim result As String = strmRderstrmRder.ReadToEnd()
strmRder.Close()
Return result
End Function
Public Sub EmailWebPage()
Dim myMail As New MailMessage()
myMail.From = New MailAddress("From Email Address")
myMail.To.Add("To Email Address")
myMail.Subject = "Email Subject"
Dim htmlPg As String = SendWebPage("http://servername/htmlpage.html")
myMail.Body = htmlPg
myMail.IsBodyHtml = True
Dim smtp As New SmtpClient(<SMTP SERVER>)
smtp.Send(myMail)
End Sub
Public Function SendWebPage(ByVal url As String) As String
Dim objRequest As WebRequest = System.Net.HttpWebRequest.Create(url)
Dim strmRder As New StreamReader(objRequest.GetResponse ().GetResponseStream())
Dim result As String = strmRderstrmRder.ReadToEnd()
strmRder.Close()
Return result
End Function
No comments:
Post a Comment