Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hoe to send current page as attached file?

Status
Not open for further replies.

rgao

Technical User
Feb 1, 2002
38
CA
I want to add a "Email it" button in my asp page, if people type in email address ,then clicked it, it will send current web page as attached file to the spacified email-address. who knows how to do it? I'm looking forward ro hearing from you.Thank you!
 
Here's a simple example using CDONTS as your email component:

<%
If Request.Form(&quot;Email_It&quot;) = &quot;yes&quot; Then
Call sendMail(Request.Form(&quot;Email_Address&quot;))
Else
%>
<Form method=&quot;post&quot; name=&quot;Email&quot; action=&quot;thispage.asp&quot;>
<input type=&quot;Hidden&quot; value=&quot;yes&quot; name=&quot;Email_It&quot;>
<input type=&quot;Submit&quot; value=&quot;Email it&quot; name=&quot;Submit&quot;>
</Form>
<%
End If

Sub sendMail (sEmail)
Dim Mail
Set Mail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
Mail.From = &quot;youremail@yourdomain.com&quot;
Mail.To = sEmail
Mail.Subject = &quot;This is the page you requested&quot;
Mail.Body = &quot;Type in your message here&quot;
Mail.AttachFile Request.ServerVariables(&quot;PATH_TRANSLATED&quot;)
Mail.Send
Set Mail = Nothing
End Sub
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top