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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending a page via e-mail (asp, cdon'ts, html e-mail) 1

Status
Not open for further replies.

aspjunior

Programmer
Feb 6, 2003
3
0
0
GB
Once I've looped through a record set and displayed articles for a particular date (asp and vbscript) I need the admin user to be able to e-mail this page to a bunch of people.
I'm not sure how to get started. Someone suggested using a div and innerhtml but not sure how to build my string to use in Cdonts. It will need to be in html.
Any help appreciated...
 
Here are the building blocks of a CDONT email
Code:
lsBody = "Build your body here"


' Create a new mail object
Set mailMessage = server.CreateObject("CDONTS.NewMail")
mailMessage.To = rsUsers("EmailAddress")
mailMessage.From = "The Webmaster" '
mailMessage.Subject = "Hello World"
mailMessage.Body = lsBody
mailMessage.MailFormat = 0  'send HTML format
mailMessage.BodyFormat = 0  'same
mailMessage.Send
set mailMessage = nothing

Steve Davis
hey.you@hahaha.com.au

Me? I can't even spell ASP!
 
Is there an easy way to build the string from the recordset that has already looped and displayed the list on the page before the user hits "email"?
I'd like to pick all that stuff up eg. <div id=content> and then somehow use innerhtml for the variable lsBody so that I don't have to build the page again just for the e-mail.
If that's a possibility??

lsBody = "Build your body here"
 
Thinking quickly, I would build the body as it was looping to display the page - kill two birds with one connection.

Then when the page has finished, using the string of HTML you have created, loop through the users base and send the emails.

Steve Davis
hey.you@hahaha.com.au

Me? I can't even spell ASP!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top