Code:
sMsg = "<table><tr><td>SomeHTML stuff</td></tr></table>"
Do While Not Rs.EOF
SendEmail Rs("Name"), "your@email", "some Subject", "Dear " & Rs("Name") & sMsg
Rs.MoveNext
Loop
Function SendEmail(sTo, sFrom, sSubject, sBody, sAttach)
Dim objCDO
'Create a new CDO objects
Set objCDO = Server.CreateObject("CDONTS.NewMail")
'Enter the sender's email address
objCDO.To = sTo
'Enter the recipients of this email, use ; to separate the addresses
objCDO.From = sFrom
'Enter the subject of this email
objCDO.Subject = sSubject
objCDO.BodyFormat = 0 'CdoBodyFormatHTML
objCDO.MailFormat = 0 'CdoMailFormatMime
objCDO.AddAttachment(sAttach)
'Enter the body text of the message
objCDO.Body = sBody
'Send the email!
objCDO.Send
'Release the object
set objCDO=nothing
End Function
I am a loud man with a very large hat. This means I am in charge