Solved

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

Posted on 2010-09-13
4
407 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 500 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
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…

628 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