I almost figured this problem out. I'm new to .asp, and I've been self taught.
The problem that I am having is when I select multiple checkboxes on my form and post them to my mail server as the body of the e-mail, the values are being seperated by a comma. I need the values to be seperated by a <br>. I have found some code that will do just that, but it will only write them to the screen. I can't figure out how to send what I write to the screen to my e-mail.
Here is the code I am working with.
The problem that I am having is when I select multiple checkboxes on my form and post them to my mail server as the body of the e-mail, the values are being seperated by a comma. I need the values to be seperated by a <br>. I have found some code that will do just that, but it will only write them to the screen. I can't figure out how to send what I write to the screen to my e-mail.
Here is the code I am working with.
Code:
<%
strHost = "mail.host.org"
If Request("Send") <> "" Then
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = strHost
Mail.From = Request("From")
Mail.FromName = Request("FromName")
Mail.AddAddress Request("To")
Mail.Subject = Request("Subject")
Mail.Body = Request("checkbox")
strErr = ""
bSuccess = False
On Error Resume Next
Mail.Send
If Err <> 0 Then
strErr = Err.Description
else
bSuccess = True
End If
End If
%>
<body>
<%
If Len(Request("checkbox")) > 0 Then
For Each item in Request("checkbox")
newVar = newVar & item & "<br>"
Next
Response.Write(newVar)
End If
%>
<FORM Name="mail" METHOD="POST" ACTION="sample.asp">
<INPUT TYPE="hidden" NAME="To" value="mail@host.org">
<INPUT TYPE="hidden" NAME="Subject" value="Test">
<INPUT TYPE="hidden" NAME="From" value="mail@host.org">
<INPUT TYPE="hidden" NAME="FromName" value="Name">
<table width="100%">
<tr>
<td><input type="checkbox" name="checkbox" value="TEST1">
District202</td>
<td><input type="checkbox" name="checkbox" value="TEST2">
D202Webmaster</td>
<td><input type="checkbox" name="checkbox" value="TEST3">
TestList</td></tr>
<tr><td colspan=3>
<INPUT TYPE="SUBMIT" NAME="Send" VALUE="Send Message">
</td></tr></table>
</FORM>
</body>

