Solved

Send a web page (aspx) in the email vb.net

Posted on 2010-09-13
4
403 Views
Last Modified: 2012-05-10
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:


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

Open in new window

0
Comment
Question by:CompGenHosp
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
Amandeep Singh Bhullar earned 500 total points
Comment Utility
You cannot send the aspx page in a e-mail.
All you need to do is to send the part of the page in the form of HTML.
This will solve your issue
0
 
LVL 29

Expert Comment

by:Kumaraswamy R
Comment Utility
0
 
LVL 29

Expert Comment

by:Kumaraswamy R
Comment Utility
0
 

Author Closing Comment

by:CompGenHosp
Comment Utility
After more recearh found that the aspx page can't be sent in the emial.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to dynamically set the form action using jQuery.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now