<%
function IsEmail(strEmail)
Dim objRegExp
Set objRegExp = New RegExp
objRegExp.Pattern = "^[a-z0-9._-]+\@[a-z0-9._-]+\.[a-z0-9]{2,4}$"
objRegExp.IgnoreCase = True
IsEmail = objRegExp.Test(strEmail)
end function
function checkForm()
checkForm=false
if not isEmpty(request.Form("nomeCognome")) And request.Form("nomeCognome")<> "nome cognome" and not isNumeric(request.Form("nomeCognome")) then
if not isEmpty(request.Form("natoA")) And request.Form("natoA")<> "---" And not isNumeric(request.Form("natoA")) then
if not isEmpty(request.Form("il")) And IsDate(request.Form("il")) then
if not isEmpty(request.Form("residenza")) And not isNumeric(request.Form("residenza")) then
if not isNumeric(request.Form("citta")) and not isEmpty(request.Form("citta")) then
if isNumeric(request.Form("cap")) and not isEmpty(request.Form("cap")) then
if not isEmpty(request.Form("tel")) and isNumeric(request.Form("tel")) and IsEmail( request.Form("email")) then
checkForm=true
end if
end if
end if
end if
end if
end if
end if
if not checkForm And request("Button")="Invia" then
%>
<%
end if
end function
If request("Button")="Invia" And checkForm() then
' Dichiara l'oggetto email e la configurazione
Dim objMail, objConfig
' Dimensiona l'oggetto email
Set objMail = CreateObject("CDO.Message")
' ====================================
'Dimensiona l'oggetto configurazione
Set objConfig = Server.CreateObject("CDO.Configuration")
' Imposta le configurazioni
With objConfig
' Server SMTP di uscita
'Esempio mail.dominio.it
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.fondazionerobertocapucci.com"
' Porta SMTP
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' Porta CDO
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
' Timeout
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Fields.Update
End With
' Assegna le configurazioni
Set objMail.Configuration = objConfig
' Assegna all'oggetto le proprietà necessarie
' Mittente dell'email (indirizzo)
objMail.From = Request.Form("email")
' Destinatario dell'email (indirizzo)
objMail.To = "formazione@fondazionerobertocapucci.com"
' Cc e Bcc (opzionale)
'objMail.Cc = "luana.briglia@fastwebnet.it"
'objMail.Bcc = "altroindirizzo@dominio.xx; ancora@dominio.xx"
' Oggetto dell'email
objMail.Subject = "Materia e Forma II - Tecniche di decorazione e trasformazione della materia che si terrà dal 6 all'8 maggio 2010"
'' Valore di priorità
objMail.Fields("urn:schemas:httpmail:importance").Value = 2
objMail.Fields.Update()
' Allegare un file
'objMail.AddAttachment("d:\inetpub\webs\tuodominiocom\file.zip")
Dim HTML, seminario
seminario="Materia e forma II - Tecniche di decorazione e trasformazione della materia che si terrà dal 6 all'8 maggio 2010"
HTML = ""
HTML = HTML & ""
HTML = HTML & "
"
HTML = HTML & "
Prove di Spedizione HTML"
HTML = HTML & ""
HTML = HTML & ""
HTML = HTML & "
Richiesta iscrizione al seminario:
"& seminario & "
"
HTML = HTML & "
Da:" & request.Form("nomeCognome") & "
"
HTML = HTML & "
Nato a:" & request.Form("natoA") & " "
HTML = HTML & "
il:" & request.Form("il") & "
"
HTML = HTML & "
residente in:" & request.Form("residenza") & "
"
HTML = HTML & "
Città:" & request.Form("citta") & "
"
HTML = HTML & "
C.A.P.:" & request.Form("cap") & "
"
HTML = HTML & "
Tel:" & request.Form("tel") & "
"
HTML = HTML & "
Email:
"& request.Form("email")& ""
HTML = HTML & "
Qualità di:" & request.Form("carica") & "
"
HTML = HTML & "
Specifica:" & request.Form("di") & "
"
HTML = HTML & ""
' Corpo del messaggio
'objMail.TextBody = "Testo della mail" 'Formato Testo
objMail.HTMLBody = HTML 'Formato HTML
' Invia l'email
objMail.Send()
' Distruggi l'oggetto
Set objMail = Nothing
%>
<% End if
%>