%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
SendEmail=false
if trim(Request.Form("submit"))<>"" then
' controllo campi
if (trim(Request.Form("azienda"))="") or (trim(Request.Form("referente"))="") or (trim(Request.Form("indirizzo"))="") or (trim(Request.Form("citta"))="") or (trim(Request.Form("phone"))="") or (trim(Request.Form("email"))="") then msg="Attenzione! I campi contrassegnati con (*) sono obbligatori" else SendEmail=true
End if
%>
<%
'Send HTML Formatted Mail with CDO - Copyright (c) 2001 George Petrov, www.UDzone.com
Sub GP_SendHtmlMail(Sender,Receiver,ccReceiver,Subject,Redirect,MailBody,MailServer)
Dim regEx, Match, Matches ' Create variable.
Set regEx = New RegExp ' Create a regular expression.
regEx.Pattern = "[=""]([^""\s]*(\.gif|\.jpg|\.jpeg|\.png|\.css|\.js))[""\s]" ' Set pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
newHTML = MailBody
Set Matches = regEx.Execute(newHTML) ' Execute search.
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.From = Sender
objCDO.To = Receiver
'-- For Blind Copy --
if ccReceiver <> "" then
objCDO.CC = ccReceiver
end if
objCDO.MailFormat = 0 ' HTML Mail
objCDO.BodyFormat = 0 ' HTML Mail
on error resume next
For Each Match in Matches ' Iterate Matches collection.
AttName = Mid(newHTML,Match.FirstIndex+2,Match.Length-2)
GP_ImgPath = Request.ServerVariables("PATH_INFO")
GP_ImgPath = Trim(Mid(GP_ImgPath,1,InStrRev(GP_ImgPath,"/")) & FilePath & AttName)
if InStr(GP_ImgPath,"://") = 0 then
GP_ImgPath = Trim(Server.mappath(GP_ImgPath))
objCDO.AttachURL GP_ImgPath, AttName
if err.number <> 0 then
response.Write AttName & " "
response.Write "Error occured! Code " & err.number & " : " & Err.Description
Response.End
end if
end if
Next
objCDO.Subject = Subject
objCDO.Body = newHTML
objCDO.Send()
Set objCDO = Nothing
if err.number <> 0 then
Response.Write "SendMail Error: " & Err.description & ", code = " & err.number
Response.End
end if
on error goto 0
if Redirect <> "" then
Response.Redirect(Redirect)
end if
end sub
'Send HTML Formatted Mail with CDO - Copyright (c) 2001 George Petrov, www.UDzone.com
if (cStr(Request("Submit")) <> "") and SendEmail Then
mailBody = GP_GenerateMailBody() 'email-contatto.asp,single,onsubmit
GP_SendHtmlMail Request.Form("email"),"info@letservice.it","","Laboratorio Enologico Toscano - Modulo Contatto","default.html",mailBody,""
end if
%>
LET LABORATORIO ENOLOGICO TOSCANO Informazioni contatto