Click to See Complete Forum and Search --> : Help !!


tuanyong
08-28-2003, 03:14 AM
does anyone know how to retrieve data from a database such that it can be sent out as an email from a browser .
please provide some help if possible as this thing is really important and urgent ..

thanks a lot ...

bloke
08-28-2003, 06:07 AM
Retrieve the information from your database and use CDONTS (or CDOSYS) to populate and send the mail:

' *** mail routine start
Dim mailBody
Dim objCDOMail 'The CDO object

' Create NewMail object
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
' Set the properties of the object
objCDOMail.From = "you@yourdomain.com"
objCDOMail.To = "<%=rsX("recipient")%>"

objCDOMail.Subject = "Your Subject" & Request
'body text
mailBody = "Some wording here or something"

objCDOMail.Body = mailBody

' Send the message
objCDOMail.Send

Set objCDOMail = Nothing
' *** mail routine end