CompGenHosp
asked on
Send a web page (aspx) in the email vb.net
I want to send a content of the web page in the email. I’m getting: “The remote server returned an error: (401) Unauthorized.” error.
Please help.
I use the following the following code:
Please help.
I use the following the following code:
Dim url As String = "http://sf3876IS/ZZZ/xxxxx.aspx?JETNum=" & JETNum & "&PrID=" & vPrID & "&CurID=" & vCurID & ""
Email.Body = HttpContent(url) & vBODY
Private Function HttpContent(ByVal url As String) As String
Dim objRequest As WebRequest = System.Net.HttpWebRequest.Create(url)
objRequest.Credentials = New NetworkCredential("username", "password")
Dim sr As New StreamReader(objRequest.GetResponse().GetResponseStream())
Dim result As String = sr.ReadToEnd()
sr.Close()
Return result
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
After more recearh found that the aspx page can't be sent in the emial.
http://www.systemwebmail.com/faq/3.2.aspx
http://www.dotnetcurry.com/ShowArticle.aspx?ID=65&AspxAutoDetectCookieSupport=1