Click to See Complete Forum and Search --> : Simple Question


Solace
05-12-2004, 06:06 PM
Hello all. I have an asp form with the recipient in a hidden field. My question is how would I have the results of the form be emailed to two different email addresses. Probably sounds stupid but any help would be appreciated. Thanks.

buntine
05-12-2004, 10:46 PM
Add some more data to the hidden form control, so its like a delimited list.

<input type="hidden" name="recipients" value="you@here.com;me@there.com" />

Then, in your ASP code, use the VBScript Split() function to split the string up.

Dim arrRecipients

arrRecipients = Split(CStr(Request.Form("recipients")), ";")

For i = 0 To Len(arrRecipients) - 1
'|Add your address's here.
mailObj.addAddress(arrRecipients(i))
Next

The preceding code simply creates an array of sub-strings. You may have to alter the statement within the for loop to comply with the mail object your using.

Regards,
Andrew Buntine.

Solace
05-13-2004, 10:31 AM
Thanks Andrew. As always, very helpful.