I have a form that displays several records that include email addresses. I would like to send to each email address the corresponding data but its not working. All the information is put in one email. How can I get it to send out one email with that reocrds' information? Below is the code for sending out the email.
<%
Dim strBody
Dim newMail
Dim oldMail
strBODY = strBODY & " Chargebacks List" & vbCrLf & vbCrLf
'================================================= ====================================
' Body of message
strBODY = strBODY & "Item Number: " & Request.form("itemID") & vbCrLf
strBODY = strBODY & "NAME: " & Request.form("GivenName") & vbCrLf
strBODY = strBODY & "DATE: " & Request.form("date") & vbCrLf
strBODY = strBODY & "Description: " & Request.form("Description") & vbCrLf
strBODY = strBODY & "Budget#: " & Request.form("budget")& vbCrLf
strBODY = strBODY & "Hours: " & Request.form("Hours") & vbCrLf
strBODY = strBODY & "TOTAL DOLLARS: " & Request.form("TotalDollars") & vbCrLf
strBODY = strBODY & "UNIT MANAGER: "& Request.form("ReportTo") & vbCrLf
strBODY = strBODY & "UNIT MANAGER EMAIL: " & Request.form("ReportToemail") & vbCrLf
%>
<%
Dim myMail
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Chargeback Notification"
myMail.From="
[email protected]"
myMail.To= Request.Form("ReportToemail")
myMail.TextBody=strBODY
myMail.Send
%>
<HTML>
<head>
<style>a {color:blue;}</style>
</head>
<table align="center" border="1" width="53%" cellspacing="0" cellpadding="0" height="52">
<tr>
<td width="100%" bgcolor="#FFC68C" height="10" valign="middle" align="center"><b>Confirmation</b></td>
</tr>
<tr>
<td width="100%" height="40" valign="middle" align="center">Email sent successfully</td>
</tr>
<tr>
</tr>
<tr>
<td width="100%" height="2" valign="middle" align="center" bgcolor="#FFC68C">
<a href="chargeback_menu.htm">Return to menu</a></td>
</tr>
</table>
</HTML>