473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to mail current open Page

Hi All,

How can i mail the current open page? The open page contains some data
(which vary every time page is opened), textbox to enter email id and
send button. When the send button is clicked i want to mail this page as
it is to the given email id.
regards
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #1
3 1225
Hi Kuldeep,
If you are looking to send the content of page as body of the mail to a
recipient then you can follow these steps
1) Keep all the content that has to be mailed inside a panel control.
2) When you send mail the mail format should be Html and the body of the
mail will be the content of the panel.
You can get the content of the panel by using RenderControl. I am pasting
some part of the code which might help you
Dim strWriter As StringWriter = New StringWriter
Dim myTextWriter As HtmlTextWriter = New HtmlTextWriter(strWriter)
Dim mymail As New Mail.MailMessage
mymail.BodyFormat = MailFormat.Html
Panel1.RenderControl(myTextWriter)
mymail.Body = strWriter.ToString
In case you have further questions please revert.
--
The best
srini
http://www.expertszone.com
"Kuldeep" wrote:
Hi All,

How can i mail the current open page? The open page contains some data
(which vary every time page is opened), textbox to enter email id and
send button. When the send button is clicked i want to mail this page as
it is to the given email id.
regards
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #2
Rick Strahl did wrote a good post on the subject :

http://west-wind.com/weblog/posts/481.aspx

Let me know if you have any more questions..

Cheers,
Tom Pester
Hi All,

How can i mail the current open page? The open page contains some data
(which vary every time page is opened), textbox to enter email id and
send button. When the send button is clicked i want to mail this page
as it is to the given email id.

regards

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #3
Hi everybody,

Thanks for replying to my post and i'm sorry for being late in
responding.

I was able to solve my problem using the following code
Dim wreq As WebRequest =
HttpWebRequest.Create("http://localhost/myPage.aspx")

Dim wrsp As WebResponse = wreq.GetResponse()
Dim sr As StreamReader = New StreamReader(wrsp.GetResponseStream())

Dim strHTML As String = sr.ReadToEnd()
sr.Close()

Dim msg As New MailMessage
msg.From = "my**@yahoo.com"
msg.To = "yo****@yahoo.com"
msg.Subject = "HTML page"
msg.Body = strHTML
msg.BodyFormat = MailFormat.Html
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(msg)
Regards,
Kuldeep

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephajn Craig | last post by:
It's been a while since I posted here, but here goes. Our server is a Windows 2000 Server with Service Pack 3, IIS 5 with Lockdown Wizard applied. My first problem is related to...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
2
by: Mike Stephens | last post by:
A contact management application we previously developed for a customer now has a requirement to perform mail merging. Normally request like this would be very simple to solve, we were just point...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
7
by: GeorgeAtkins | last post by:
I want to create a web-based form or page that consists of a series of formatted questions and answers. The form will resemble an existing paper form. When the form is filled in, I want the user to...
0
by: Avi | last post by:
A CreateUserWizard contorl receives new user details, adds the user to the database, tries to send a confirmation mail message and stops with a "System.FormatException: The specified string is not...
1
by: William Connery | last post by:
Hi, I have a small python program with e-mail capabilities that I have pieced together from code snippets found on the internet. The program uses the smtplib module to successfully send an...
10
by: Frank | last post by:
Hi, I am hoping to find out the differences between the System.Net.Mail and System.Web.Mail. Can some nice folks post the differences; or some urls which show the differences? Great Thanks...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.