Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-09-13
4
Medium Priority
?
409 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
Amandeep Singh Bhullar earned 1500 total points
ID: 33663742
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
ID: 33664102
0
 

Author Closing Comment

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

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

721 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