% dim strPageName strPageName = "contact" Sub WritePage %> <% Dim strErrorMessage, strConfirmationMessage Dim strTo, strBCC, strSenderName, strFrom Dim objMailer, blnsend 'CDO mailer object Response.Write Request("cboCountry") 'when form is submitted send mail. If Not ( isEmpty(Request.Form) ) Then 'Form submitted, perform validation checks: strTo = Application("DefaultEmail") strBCC = Application("BCCEmail") strSenderName = Request.Form("txtName") strFrom = Request.Form("txtEmail") Set objMailer = Server.CreateObject("CDONTS.NewMail") With objMailer .To = """" & "Substance Publishing" & """" & " " & "<" & strTo & ">" 'BCC email id's If strBCC <> "" Then .Bcc = """" & "Substance Publishing" & """" & " " & "<" & strBCC & ">" End if 'Sender name if its there otherwise just email id If strSenderName = "" Then .From = strFrom Else .From = """" & strSenderName & """" & " " & "<" & strFrom & ">" End if 'Email subject .Subject = "Message from Substance Publishing Web site" 'Body of the email whether its in html format or text format .BodyFormat = 1 'Content of mail dim strGender if Request.Form("optGender") = 0 then strGender = "Male" else strGender = "Female" end if .Body = "This is a request from the Substance Publishing website" & vbCrLf & vbCrLf & _ "Title :- " & Request.Form("hidTitle") & vbCrLf & vbCrLf & _ "First name :- " & Request.Form("txtFirstName") & vbCrLf & vbCrLf & _ "Last name :- " & Request.Form("txtLastName") & vbCrLf & vbCrLf & _ "Telephone No :- " & Request.Form("txtDayTele") & vbCrLf & vbCrLf & _ "Email :- " & Request.Form("txtEmail") & vbCrLf & vbCrLf & _ "Country :- " & Request.Form("hidCountry") & vbCrLf & vbCrLf & _ "Gender :- " & strGender & vbCrLf & vbCrLf .Send blnsend = true '"Field Name" & Request.Form("txtFieldName") & vbCrLf & vbCrLf & _ End With If blnsend Then 'Mail sent strConfirmationMessage = "Thank you for your request. We will be in touch with you shortly." Else 'Send Mail failed strErrorMessage = "Unfortunately your details could not be accepted because the mail object failed to send the mail." End If Set objMailer = Nothing End If %>
<% End Sub %>