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!

Email 1

Status
Not open for further replies.
Aug 2, 2002
28
GB
Hello,

I’m not sure what I am trying to do is possible but here goes…

We have a web online booking system for a holiday company. Half way through we let users print a page via JavaScript, using innerHTML so that they have a paper version of the quote.

Ideally what I would like to do is capture the web page and let someone email the page, i.e. like ‘email a friend’.

If I could insert the HTML that is the innerHTML and add it to a mailto this would be ideal but I was wondering whether anything existed with ASP that could do this job?

Unfortunately, we are not able to store the link as each link is unique and to revisit would produce an error.

If anyone could throw any suggestions my way it would be most appreciated.

Thank you.

 
Since email from asp requires action on the server, you would need to post the email content back to the server to send an email. This could be done with a form that has a target to _blank so that it doesn't affect the page you are on....

<form action="sendEmail.asp" target="_blank">
<input type="Hidden" value="This is my email body" name="my EmailBody">
<input type=Submit value="Send Email">
</form>

Put that on you page and have the sendEmail.asp page take the emailbody and send it. The page could then display "Email Sent".
 
Search this site, especially the FAQs, or Google for CDO to learn how to send email from the server.

A word of warning: Unless your web server is running Windows NT4, disregard references to the older techniques based on CDONTS.
 
Hi Sheco,

CDO was they way to go! Thank you very much. Here is the code I eventually used.

<%

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Test Email"
myMail.From=anyone@emailaddress.net
myMail.To=anyone@emailaddress.net
myMail.HTMLBody = "body of the email including any HTML"
myMail.Send
set myMail=nothing

%>

Thanks again.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top