For Each statement creates duplicate emails
I have a function that is supposed to collect records of our agents who have not paid a certain bill. For some reason when I invoke the 'sendmail' routine using a for each statement it will send 2 notification emails to each address. I have only 2 records that match the criteria for testing purposes right now and the view I created to match shows just those 2 using the same criteria. Here is the function I call from that view to send the emails:
void agent_management.getunpaidfullwebsite (string toaddress )
for each GetUnpaidFullWebsite in Agent_Entry [(Website_Type == "Full" && Paid_for_Full_Website == "No")]
{
| |
SendMail [ From : zoho.adminuserid To : GetUnpaidFullWebsite.Company_Email Subject : "test" Message : "test<br>" ]
|
}
Any ideas on what I'm doing wrong? Note: I left the (string toaddress) in but I don't use it - I'm not sure if there is a better way to do that.
Thanks!
Parker Byron
Network Administrator
Kansas City Regional Homes, Inc.