how to send a web page to mail
Reply
![]() |
|
|
From:
Balu
|
Can any one suggest me how to send a web page to mail using c# ? I have tried using HttpWebRequest method but i am getting the following error System.Net.WebException: The remote server returned an error: (401) Unauthorized. MailMessage mail = new MailMessage(); mail.To = "test.com"; mail.From = "[EMAIL PROTECTED]"; mail.Subject = "this is a test email."; mail.Body = HttpContent(Url1); mail.BodyFormat = MailFormat.Html; mail.UrlContentBase = Url1; SmtpMail.SmtpServer = "localhost"; SmtpMail.Send( mail ) private string HttpContent( string url ) { WebRequest objRequest= System.Net.HttpWebRequest.Create(url); StreamReader sr = new StreamReader( objRequest.GetResponse().GetResponseStream() ); string result = sr.ReadToEnd(); sr.Close(); return result; Regards, Bala |
|
View other groups in this category.
![]() |
To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.
Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.
If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.
|
|