Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack = True Then For intX As Int32 = 1 To 15 cklWorkWillingStations.Items.Add("Station " & intX) Next cklWorkWillingStations.Items.Add("Dispatch") End If If Not Page.IsPostBack = True Then For intX As Int32 = 1 To 15 cklwillingtofirst.Items.Add("Station " & intX) Next End If End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click Dim objMailClient As System.Net.Mail.SmtpClient Dim objMailMessage As System.Net.Mail.MailMessage Dim strHost As String = "70.60.17.9" Dim strMessage As String = String.Empty Dim strTo As String = "uaf@seoems.com" Dim strFrom As String = "uaf@seoems.com" Dim strSubject As String = "Universal Alert Form" Dim intX As Int32 = 0 Dim bolFirstItem As Boolean = True divMessage.Visible = True strMessage += "
" strMessage += "" & lblInitialOrUpdate.Text & " " & rblInitialOrUpdate.selectedvalue & "
" strMessage += "" & lblFirstName.Text & " " & txtFirstName.Text & "
" strMessage += "" & lblLastName.Text & " " & txtLastName.Text & "
" strMessage += "" & lblHomeStation.Text & " " & txtHomeStation.Text & "
" strMessage += "" & lblSeoemsEmail.Text & " " & txtSeoemsEmail.Text & "
" strMessage += "" & lblCertLevel.Text & " " & txtCertLevel.Text & "
" strMessage += "" & lblSeoemsId.Text & " " & txtSeoemsId.Text & "
" strMessage += "" & lblWorkWillingStations.Text & " " Try 'This Loop adds to the email, all the stations which the employee checks--------- For intX = 0 To cklWorkWillingStations.Items.Count - 1 If cklWorkWillingStations.Items(intX).Selected = True Then If bolFirstItem = False Then strMessage += ", " End If strMessage += cklWorkWillingStations.Items(intX).Text bolFirstItem = False End If Next Catch ex As Exception End Try strMessage += "
" strMessage += "" & lblwillingtofirst.Text & " " Try 'This Loop adds to the email, all the stations which the employee checks--------- bolFirstItem = True For intX = 0 To cklwillingtofirst.Items.Count - 1 If cklwillingtofirst.Items(intX).Selected = True Then If bolFirstItem = False Then strMessage += ", " End If strMessage += cklwillingtofirst.Items(intX).Text bolFirstItem = False End If Next Catch ex As Exception End Try strMessage += "
" strMessage += "" & lblAllCallsForCounties.Text & " " 'This Loop adds to the email, all the counties which the employee checks--------- bolFirstItem = True For intX = 0 To cklAllCallsForCounties.Items.Count - 1 If cklAllCallsForCounties.Items(intX).Selected = True Then If bolFirstItem = False Then strMessage += ", " End If strMessage += cklAllCallsForCounties.Items(intX).Text bolFirstItem = False End If Next strMessage += "
" strMessage += "" & lblTextMessaging.Text & " " If Not rblTextMessaging.SelectedItem Is Nothing = True Then strMessage += rblTextMessaging.SelectedItem.Text Else strMessage += "No Counties Were Selected" End If strMessage += "
" strMessage += "" & lblPhoneNumber.Text & " " & txtPhoneNumber.Text & "
" strMessage += "" & lblCellCarrierName.Text & " " & txtCellCarrierName.Text & "
" strMessage += "
" 'COMMENT or remove the next 4 lines of code and UNCOMMENT the following 5 lines of code, before you put this in production------------------------------------------------------- 'strMessage = strMessage.Insert(strMessage.LastIndexOf("<"), "") 'lblTest.Text = "