VS.NET 2010 (and above) Users Click Here   

HOMECONTACT PRODUCTS DOWNLOADS PURCHASE TESTIMONIALS FORUMS COMPANY CONTACT
Home
Products
Downloads
Purchase
Licensing
Licensing FAQ
Software Updates
Support Forums
Testimonials
Feature Requests
Guarantee
About Us
Contact Us
Hosting Companies
Privacy Policy
   
Shopping Cart


aspNetEmail forum



[ Reply to Post ] [ Back To Forum ]
From: "dave wanta" <dave@...>
Date: 6/4/2014 5:30:36 AM
Subject: RE: System.Net.WebException: The remote server returned an error: (401)
Sure! Try something like:

EmailMessage msg = new EmailMessage();
msg.Logging = true;
msg.LogPath = "c:\\whatever\email.log";

HtmlUtility utility = new HtmlUtility(msg);
string url = "http://www.example.com";;

//wire up the events

//this is for creating the webrequest
utility.CreateWebRequest += new CreateWebRequestEventHandler( OnCreateWebRequest );

//or, right before the webrequest makes the call
utility.BeforeWebRequest += new BeforeWebRequestEventHandler( OnBeforeWebRequest );

private void OnBeforeWebRequest( object sender, BeforeWebRequestEventArgs e )
{
	//if we wanted to override the webrequest object, we could get it here
	
	e.WebRequest

}


private void OnCreateWebRequest( object sender,  CreateWebRequestEventArgs e )
{
  //override any properties used for creating the webrequest
  e.Referrer = "..."
}



 

 

 



Thread View

Subject By Date
System.Net.WebException: The remote server returned an error: (401) Kevin 6/3/2014
   RE: System.Net.WebException: The remote server returned an error: (401) dave wanta 6/3/2014
     RE: System.Net.WebException: The remote server returned an error: (401) Kevin 6/3/2014
     RE: System.Net.WebException: The remote server returned an error: (401) Kevin 6/3/2014
       RE: System.Net.WebException: The remote server returned an error: (401) dave wanta 6/3/2014
         RE: System.Net.WebException: The remote server returned an error: (401) Kevin 6/3/2014
           RE: System.Net.WebException: The remote server returned an error: (401) [ you are here ] dave wanta 6/4/2014

 

 

Testimonial

aspNetEmail is a very nice product that is extremely simple to use. Such personal attention! I am impressed. "

Ross

Read more testimonials
ListNanny aspNetDNS aspNetEmail aspNetPOP3 aspNetMX IPMuncher aspNetMIME aspNetPING aspNetTraceRoute aspNetIMAP aspNetMHT