Contact Us Contact Us
Home | How We Work | Services | Clients | The EMS Story | HELP Me Now!
Speaker's Digest | Fundamentals of Public Speaking | EMS Glossary of Terms | Fact Sheet     Bookmark and Share

Contact EMS

<% If Action = "SendEmail" Then ' Here we quickly check/validate the information entered ' These checks could easily be improved to look for more things If IsValidEmail(ContactUs_Email) = "False" Then IsError = "Yes" Response.Write("You did not enter a valid email address.
") End If If ContactUs_Name = "" Then IsError = "Yes" Response.Write("You did not enter a Name.
") End If If ContactUs_Body = "" Then IsError = "Yes" Response.Write("You did not enter a message.
") End If End If ' If there were no input errors and the action of the form is "SendEMail" we send the email off If Action = "SendEmail" And IsError <> "Yes" Then Dim strBody ' Here we create a nice looking html body for the email strBody = strBody & "Contact Us Form submitted at " & Now() & vbCrLf & "

" ' strBody = strBody & "From http://" & Request.ServerVariables("HTTP_HOST") & vbCrLf & "
" strBody = strBody & "Name" & " : " & " " & Replace(ContactUs_Name,vbCr,"
") & "
" strBody = strBody & "Company" & " : " & " " & Replace(ContactUs_Company,vbCr,"
") & "
" strBody = strBody & "Position" & " : " & " " & Replace(ContactUs_Position,vbCr,"
") & "
" strBody = strBody & "City" & " : " & " " & Replace(ContactUs_City,vbCr,"
") & "
" strBody = strBody & "Phone" & " : " & " " & Replace(ContactUs_Phone,vbCr,"
") & "
" strBody = strBody & "Email" & " : " & " " & Replace(ContactUs_Email,vbCr,"
") & "
" strBody = strBody & "
" & Replace(ContactUs_Body,vbCr,"
") & "
" strBody = strBody & "
" & "IP " & Request.ServerVariables("REMOTE_ADDR") & vbCrLf & "
" strBody = strBody & "
" Dim ObjSendMail Set ObjSendMail = CreateObject("CDO.Message") 'This section provides the configuration information for the remote SMTP server. ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network). ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpserver ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False) ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = youremail ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = yourpassword ObjSendMail.Configuration.Fields.Update 'End remote SMTP server configuration section== ObjSendMail.To = youremail ObjSendMail.Subject = ContactUs_Subject ObjSendMail.From = ContactUs_Email ' we are sending a html email.. simply switch the comments around to send a text email instead ObjSendMail.HTMLBody = strBody 'ObjSendMail.TextBody = strBody ObjSendMail.Send Set ObjSendMail = Nothing ' change the success messages below to say or do whatever you like ' you could do a response.redirect or offer a hyperlink somewhere.. etc etc %>

Your message as seen below has been sent. Thank You !!

<% =Replace(ContactUs_Body,vbCr,"
") %>

<% Else %>
Contact Us:

name:
company:
position:
city:
phone:
email:
message:
 
   
  EMS COMMUNICATIONS
555 Skokie Boulevard
Suite 260
Northbrook, IL 60062
Phone: 847-504-0108
Fax: 847-267-0800
<% End If %>
© 2010 EMS Communications, LLC. All rights reserved.