Hello,
Im trying to generate an email with Multiple Listbox selections... Unfortunately the listbox allows me to select multiple choice but when I submit the form only one "selection" is shown... Im assuming a for each or something will be needed here... all tests using that method have failed. Could someone point me in the right direct or show me?
<script runat="server">
void btnSubmit_Click(Object sender, EventArgs e) {
MailMessage objEmail = new MailMessage();
objEmail.To = txtTo.Text;
objEmail.From = txtFrom.Text;
objEmail.Subject = "Sample Form";
objEmail.Body = "<h2>Sample Form Title</h2>" + "<br />" + listType.SelectedItem.Text + "<br />";
objEmail.Priority = MailPriority.High;
objEmail.BodyFormat = MailFormat.Html;
try{
SmtpMail.Send(objEmail);
Response.Write("Email Sent - Thank You!");
}
catch (Exception exc){
Response.Write("Send failure: " + exc.ToString());
}
}
</script>