PDA

View Full Version : loop in asp



Hanna Philippi
13-Apr-2005, 09:27 AM
hi everybody,

within my asp page in an entry form , every time the user
submit a comments line it should send an email to a list
of persons in my contacts database.(it is working if i send to 1 person
putting the mymail.to=hhhhh@jjjj.com but
I need to loop into the contacts database to send to many people
shall I do a loop in my asp page or call a function in the contacts.wbo
...how can I do that and what will be the best and easiest way to do it?

thks

Niklas Dahlquist
7-Dec-2005, 09:33 AM
Hi,

I would make a function that return all the contacts emails in a string like
this:
person1@company1.com;person2@company2.com;person3@ company3.com

Then I would split that string in VBScript/ASP to an array:

arrContacts = Split(theString,";")

Then make a loop in ASP:

For Each ContactEmail In arrContacts

'CDONTS-mail procedure here...

Next

Hope that helps

Kind Regards
Niklas

"Hanna Philippi" <hphilippi@icecorp.ca> skrev i meddelandet
news:WGAj6TDQFHA.1276@dacmail.dataaccess.com...
> hi everybody,
>
> within my asp page in an entry form , every time the user
> submit a comments line it should send an email to a list
> of persons in my contacts database.(it is working if i send to 1 person
> putting the mymail.to=hhhhh@jjjj.com but
> I need to loop into the contacts database to send to many people
> shall I do a loop in my asp page or call a function in the contacts.wbo
> ..how can I do that and what will be the best and easiest way to do it?
>
> thks
>
>