Imports Rocktime Imports Rocktime.Core Partial Class contact_us Inherits PageExClass #Region "Buttons" Protected Sub fdSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles fdSubmit.Click If fdPayCyclesFrequency.SelectedValue = "Other" Then fdPayCyclesOther_Custom.IsValid = (fdPayCyclesOther.Text <> "") End If If Not Page.IsValid Then Exit Sub End If Dim Email As New Rocktime.EmailClass Dim SelectedItems As String = "" Email.AddToAddress(System.Configuration.ConfigurationManager.AppSettings("DefaultSiteSender")) Email.FromAddress = fdEmail.Text Email.Subject = "Contact Us Form" Email.Body = "A User has completed the Contact Us form on payrolls.co.uk and supplied the following details." & vbCrLf & vbCrLf & _ "Name : " & fdName.Text & vbCrLf & vbCrLf & _ "Company Name : " & fdCompanyName.Text & vbCrLf & vbCrLf & _ "Company Address : " & fdCompanyAddress.Text & vbCrLf & vbCrLf & _ "Postcode : " & fdCompanyPostcode.Text & vbCrLf & vbCrLf & _ "Telephone : " & fdTelNumber.Text & vbCrLf & vbCrLf & _ "Email : " & fdEmail.Text & vbCrLf & vbCrLf & _ "Current Pay Cycles:" & vbCrLf & vbCrLf & _ " Number : " & fdPayCyclesNumber.Text & vbCrLf & vbCrLf If fdPayCyclesFrequency.SelectedValue = "Other" Then Email.Body = Email.Body & _ " Frequency : " & fdPayCyclesOther.Text & vbCrLf & vbCrLf Else Email.Body = Email.Body & _ " Frequency : " & fdPayCyclesFrequency.SelectedValue & vbCrLf & vbCrLf End If Email.Body = Email.Body & _ "Comments : " & fdComments.Text & vbCrLf & vbCrLf & _ "Contact Method : " & fdContactMethod.SelectedValue & vbCrLf & vbCrLf & _ "How did you hear about us : " & fdHowDidYouHearAboutUs.SelectedValue Email.Send() PageRedirect("ThankYou.aspx") End Sub #End Region End Class