Click to See Complete Forum and Search --> : Using array for email list collection
gcook1
01-20-2006, 09:43 AM
I have a form that has three checkboxes and an open textbox for choosing who the email feedback will go to. Somehow, I need to take the values of the checkboxes and the value in the open textbox and combine them into a string. Then the string would go in the objMail.To value. Does that make sense? What would be the best way to do this?
'after some server side validation, do:
objMail.To=request.form("mailusername") & "@" & request.form("maildomainname")
'Or something like:
select case lcase(request.form("SomeRadioButtonValue"))
case "tom"
strEmailAddressTo="tom@example.com"
case "ken"
strEmailAddressTo="ken@example.com"
case else
strEmailAddressTo="default@example.com"
end select
Something like that?
gcook1
01-23-2006, 03:07 PM
No, not exactly. Here's the html code. The idea is you can choose one or more of the three checkboxes and/or add an email of your own. But I can't seem to get the values strung together properly to use in the sendmail command.
<table width="95%" cellpadding="5" cellspacing="0" align="center" style="{border-width: 1px; border-color: gray; border-style: solid }" ID="Table1"><tr><td bgcolor="#E5E5E5">
<form name="MyForm" method="post" ID="Form1">
<table border=0 ID="Table2">
<tr><td>To:</td><td><input type=checkbox name=chkTo1 value="email1@steelcase.com" ID="Checkbox1">email1</td></tr>
<tr><td></td><td><input type=checkbox name=chkTo1 value="email2@steelcase.com" ID="Checkbox2">email2</td></tr>
<tr><td></td><td><input type=checkbox name=chkTo1 value="email3@steelcase.com" ID="Checkbox3">email3</td></tr>
<tr><td></td><td colspan=2>If other <input type="text" name="tbxTo" size="30"></td></tr>
<tr><td>Cc:</td><td><input type="text" name="tbxCc" size="30"><input type="checkbox" name="CcSender" value="yes">Send a copy to myself</td></tr>
<tr><td>From:</td><td><%= LCase(strLoginID) %></td></tr>
<tr><td>Subject:</td><td><%= FORM_NAME %></td></tr>
<tr><td>Date:</td><td><%= Date %></td></tr>
<tr><td>Time:</td><td><%= Time %></td></tr>
</table><br>
Bullschmidt
01-23-2006, 07:45 PM
objMail.To = Request.Form("chkTo1")
And that should work because Request.Form("chkTo1") already provides all the e-mail addresses each separated with a comma and space.