<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> Contact Us
<% Dim strTo, strSubject, strBody 'Strings for recipient, subject, boby Dim objCDOMail 'The CDO object 'First we'll read in the values entered strTo = "showbiz@brazilia.co.za" 'These would read the message subject and body if we let you enter it 'strSubject = Request.Form("subject") 'strBody = Request.Form("body") ' Both of these should be changed before you run this script. strSubject = "Feedback Form..." ' This is multi-lined simply for readability 'strBody = "This message was sent from a sample at http://www.asp101.com. " 'strBody = strBody & "It is used to show people how to send e-mail from an " 'strBody = strBody & "Active Server Page. If you did not request this " 'strBody = strBody & "e-mail yourself, your address was entered by one of " 'strBody = strBody & "our visitors. We do not store these e-mail addresses." 'strBody = strBody & " Please address all concerns to webmaster@asp101.com." ' Some spacing: strBody = strBody & vbCrLf 'strBody = strBody & "This was sent to: " ' A lot of people have asked how to use form data in the emails so ' I added this line to the sample as an example of incorporating form ' data in the body of the email. 'BODY.................... strBody = strBody & " -- Feedback -- " strBody = strBody & vbCrLf strBody = strBody & vbCrLf strBody = strBody & "Submitter -- " & Request.Form("submitter") strBody = strBody & vbCrLf strBody = strBody & "Company -- " & Request.Form("company") strBody = strBody & vbCrLf strBody = strBody & "HomeAddressL1 -- " & Request.Form("HomeAddress1") strBody = strBody & vbCrLf strBody = strBody & "HomeAddressL2 -- " & Request.Form("HomeAddress2") strBody = strBody & vbCrLf strBody = strBody & "City -- " & Request.Form("City") strBody = strBody & vbCrLf strBody = strBody & "Postal Code -- " & Request.Form("Code") strBody = strBody & vbCrLf strBody = strBody & "Country -- " & Request.Form("country") strBody = strBody & vbCrLf strBody = strBody & "Email -- " & Request.Form("email") strBody = strBody & vbCrLf strBody = strBody & "Cell Num -- " & Request.Form("txtCell") strBody = strBody & vbCrLf strBody = strBody & "Telephone Work -- " & Request.Form("txtTelw") strBody = strBody & vbCrLf strBody = strBody & "Telephone Home -- " & Request.Form("txtTelh") strBody = strBody & vbCrLf strBody = strBody & "Fax Num -- " & Request.Form("txtFax") strBody = strBody & vbCrLf strBody = strBody & "Comments -- " & Request.Form("txtComments") strBody = strBody & vbCrLf '........................ ' A final carriage return for good measure! 'strBody = strBody & vbCrLf 'Ok we've got the values now on to the point of the script. 'We just check to see if someone has entered anything into the to field. 'If it's equal to nothing we show the form, otherwise we send the message. 'If you were doing this for real you might want to check other fields too 'and do a little entry validation like checking for valid syntax etc. ' Note: I was getting so many bad addresses being entered and bounced ' back to me by mailservers that I've added a quick validation routine. If Request.Form("Submit") <> "Submit" Then %>







            Complete the form below for further information:
Full Name :
Company :
Home Address 1:
Home Address 2:
City :
Postal Code :
Country :
Email : Comments:
Cell :
Tel (w) :
Tel (h) :
Fax :
<% Else ' Create an instance of the NewMail object. Set objCDOMail = Server.CreateObject("CDONTS.NewMail") ' Set the properties of the object '*********************************************************** ' PLEASE CHANGE THESE SO WE DON'T APPEAR TO BE SENDING YOUR ' EMAIL. WE ALSO DON'T WANT THE EMAILS TO GET SENT TO US ' WHEN SOMETHING GOES WRONG WITH YOUR SCRIPT... THANKS '*********************************************************** ' This syntax works fine 'objCDOMail.From = "user@domain.com" ' But this gets you the appearance of a real name! objCDOMail.From = Request.Form("email") objCDOMail.To = strTo objCDOMail.Subject = strSubject objCDOMail.Body = strBody ' There are lots of other properties you can use. ' You can send HTML e-mail, attachments, etc... ' You can also modify most aspects of the message ' like importance, custom headers, ... ' Check the documentation for a full list as well ' as the correct syntax. ' Some of the more useful ones I've included samples of here: 'objCDOMail.Cc = "user@domain.com;user@domain.com" 'objCDOMail.Bcc = "user@domain.com;user@domain.com" 'objCDOMail.Importance = 1 '(0=Low, 1=Normal, 2=High) 'objCDOMail.AttachFile "c:\path\filename.txt", "filename.txt" ' I've had several requests for how to send HTML email. ' To do so simply set the body format to HTML and then ' compose your body using standard HTML tags. 'objCDOMail.BodyFormat = 0 ' CdoBodyFormatHTML 'Outlook gives you grief unless you also set: objCDOMail.MailFormat = 0 ' CdoMailFormatMime ' THIS LINE SHOULD BE UNCOMMENTED TO ACTUALLY SEND THE ' MESSAGE. PLEASE BE SURE YOU HAVE APPROPRIATE VALUES ' FOR TO AND FROM ADDRESSES AND HAVE CHANGED THE MESSAGE ' SUBJECT AND BODY BEFORE UNCOMMENTING THIS. ' Send the message! objCDOMail.Send ' Set the object to nothing because it immediately becomes ' invalid after calling the Send method. Set objCDOMail = Nothing Response.Redirect("FeedbThankYou.html") 'Response.Write "Message ARE NO LONGER BEING SENT because of all the abuse the system was receiving!" End If ' End page logic %> <% ' Only functions and subs follow! ' A quick email syntax checker. It's not perfect, ' but it's quick and easy and will catch most of ' the bad addresses than people type in. Function IsValidEmail(strEmail) Dim bIsValid bIsValid = True If Len(strEmail) < 5 Then bIsValid = False Else If Instr(1, strEmail, " ") <> 0 Then bIsValid = False Else If InStr(1, strEmail, "@", 1) < 2 Then bIsValid = False Else If InStrRev(strEmail, ".") < InStr(1, strEmail, "@", 1) + 2 Then bIsValid = False End If End If End If End If IsValidEmail = bIsValid End Function %>
  P O Box 362, Table View,
7439, South Africa
  PO Box 23696, Claremont,
7735, South Africa
  Tel: +27 (21) 556-2466   Cell: +27 (73) 871-8860
  Fax: +27 (866) 22 99 60   eMail: showbiz@brazilia.co.za
  Cell: +27 (73) 871-8860    

About Us | We Offer | Why Join US? | Competitions | Gallery | Free Listings | Links | Contact Us
Copyright © 2004 Brazilia Latin Dance Studio. All rights reserved