Ciao a tutti!!
mi aiutereste con un problema? Mi pare che il codice che uso per l'invio email in ASP non sempre invii le email.. o meglio, non le invia se chi compila il form usa FireFox.. anche se tutte le variabili passano e lo script non da errori
c'è per caso qualche errore?
Codice PHP:
<%
nome = request.Form ("nome")
cognome = request.Form ("cognome")
azienda = request.Form ("azienda")
email = request.Form ("email")
telefono = request.Form ("telefono")
fax = request.Form ("fax")
indirizzo = request.Form ("indirizzo")
citta = request.Form ("citta")
provincia = request.Form ("provincia")
cap = request.Form ("cap")
msg = ""
ok = true
if nome= "" then
msg =msg & "Il campo <span class='color1'>nome </span> non è stato riempito
"
ok = false
end if
if cognome= "" then
msg =msg & "Il campo <span class='color1'>cognome </span> non è stato riempito
"
ok = false
end if
if azienda = "" then
msg =msg & "Il campo <span class='color1'>azienda </span> non è stato riempito
"
ok = false
end if
if email= "" then
msg =msg & "Il campo <span class='color1'>email </span> non è stato riempito
"
ok = false
elseif inStr(email , "@") = false or inStr(email , ".") = false then
msg =msg & "Il campo <span class='color1'>email </span> non è corretto
"
ok = false
end if
if telefono = "" then
msg =msg & "Il campo <span class='color1'>telefono </span> non è stato riempito
"
ok = false
end if
if fax= "" then
msg =msg & "Il campo <span class='color1'>fax </span> non è stato riempito
"
ok = false
end if
if indirizzo = "" then
msg =msg & "Il campo <span class='color1'>indirizzo </span> non è stato riempito
"
ok = false
end if
if citta = "" then
msg =msg & "Il campo <span class='color1'>citta </span> non è stato riempito
"
ok = false
end if
if provincia= "" then
msg =msg & "Il campo <span class='color1'>provincia </span> non è stato riempito
"
ok = false
end if
if cap= "" then
msg =msg & "Il campo <span class='color1'>C.A.P. </span> non è stato riempito
"
ok = false
end if
if ok=true then
strHTML = "<html><body>messaggio</body></html>"
Dim objMail
' Crea l'oggetto email
Set objMail = Server.createObject("CDONTS.NewMail")
' Assegna all'oggetto le proprietà necessarie
objMail.From = email ' Mittente
objMail.To = "mia [email]email@balbla.it[/email]" ' Destinatario
objMail.Subject = "BQS, richiesta informazioni" ' Oggetto
' Impostiamo la formattazione
objMail.BodyFormat = 0 ' 1 Testo; 0 HTML
objMail.MailFormat = 0 ' 1 Testo; 0 HTML
objMail.Body = strHTML ' Messaggio
' Invia l'email
objMail.Send
Set objMail = Nothing
response.write "<h3>Richiesta inviata correttamente, grazie per averci contattato</h3>
<a href=index.html>Ritorna</a></p>"
else
response.write "<h3>Alcuni dei dati sono mancanti o non corretti.</h3>
" & msg & "
[url='javascript:history.back();'] Torna indietro[/url]</p>"
end if
%>
Grassie!!!