
18/03/2002, 04:19
|
 | Colaborador | | Fecha de Ingreso: octubre-2001 Ubicación: (cerca)
Mensajes: 1.795
Antigüedad: 23 años, 6 meses Puntos: 59 | |
Re: Formulario ASP
Código:
'Read in the users e-mail address
strReturnEmailAddress = Request.Form("email")
'Initialse strBody string with the body of the e-mail
strBody = "<h2>E-mail sent from form on Web Site</h2>"
strBody = strBody & "<br><b>Name: </b>" & Request.Form("firstName") & " " & Request.Form("lastName")
strBody = strBody & "<br><br><b>Address: -</b>"
If (Request.Form("street1")) > "" Then
strBody = strBody & "<br> " & Request.Form("street1")
End If
If (Request.Form("street2")) > "" Then
strBody = strBody & "<br> " & Request.Form("street2")
End If
If (Request.Form("town")) > "" Then
strBody = strBody & "<br> " & Request.Form("town")
End If
If (Request.Form("county")) > "" Then
strBody = strBody & "<br> " & Request.Form("county")
End If
If (Request.Form("country")) > "--- Choose One ---" Then
strBody = strBody & "<br> " & Request.Form("country")
End IF
If (Request.Form("postCode")) > "" Then
strBody = strBody & "<br> " & Request.Form("postCode")
End If
strBody = strBody & "<br><br><b>Telephone: </b>" & Request.Form("tel")
strBody = strBody & "<br><b>E-mail: </b>" & strReturnEmailAddress
strBody = strBody & "<br><br><b>Enquiry: - </b><br>" & Replace(Request.Form("enquiry"), vbCrLf, "<br>")
'Check to see if the user has entered an e-mail address and that it is a valid address otherwise set the e-mail address to your own otherwise the e-mail will be rejected
If Len(strReturnEmailAddress) < 5 OR NOT Instr(1, strReturnEmailAddress, " ") = 0 OR InStr(1, strReturnEmailAddress, "@", 1) < 2 OR InStrRev(strReturnEmailAddress, ".") < InStr(1, strReturnEmailAddress, "@", 1) Then
'Set the return e-mail address to your own
strReturnEmailAddress = strMyEmailAddress
End If
'Send the e-mail
'Create the e-mail server object
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
|