salve a tutti,
[code]
<%
Mittente=Request("nome")
EMail= Request("mail")
Localita= Request("dove")
Telefono= Request("telefono")
Cellulare = Request("cell")
Ogg= Request("oggetto")
Message = Request("Messaggio")
Flag=0
if (Mittente = "") or (EMail = "") or (Localita = "") or (Ogg = "") or (Message = "") Then
Flag=1
else
Flag=0
end if
Set myConn = Server.CreateObject("ADODB.Connection")
strConnDb = ""
strConnDb = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & server.mappath("/mdb-database/mercatino.mdb")
myConn.Open(strConnDb)
strSqlUtente = ""
strSqlUtente = "select * from mercatino where id=:1:"
strSqlUtente = replace(strSqlUtente,":1:",cint(Session("id")))
set myRsUtente = Server.CreateObject("ADODB.Recordset")
myRsUtente.Open strSqlUtente, myConn
if not(myRsUtente.eof) and not(myRsUtente.bof) then
Indirizzo = myRsUtente("indirizzo")
end if
myRsUtente.Close
set myRsUtente=nothing
myConn.Close
set myConn=nothing
'controllo del flag e invio mail
If (Flag=0) Then
Messaggio = replace((Message),chr(13)&chr(10),"
")
Dim objMail, objConfig, strOggMail, strBodyMail
Set objMail = createObject("CDO.Message")
Set objConfig = Server.createObject("CDO.Configuration")
With objConfig
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "roma4.websolutions.it"
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Fields.update
End With
Set objMail.Configuration = objConfig
objMail.From = EMail
objMail.To = Indirizzo
objMail.Subject = "Nuovo Contatto dal Mercatino di Lezionidisax.it"
objMail.Fields("urn:schemas:httpmail:importance"). Value = 2
objMail.Fields.update()
'Corpo del messaggio
strBodyMail = ""
strBodyMail = "<html><head><title>Lezionidisax.it - Nuovo Contatto</title></head><body bgcolor=#24201F><Table width=800 cellpadding=0 cellspacing=0><tr>"
strBodyMail = strBodyMail & "<td valign=top><center><Table width=800 height=80 cellpadding=0 cellspacing=0 border=0 bordercolor=#FFFFFF><tr><td width=10 valign=top></td>"
strBodyMail = strBodyMail & "<td width=400 valign=middle><img src=http://www.lezionidisax.it/titolo.jpg border=0></td><td width=390 valign=top></td></tr></table>"
strBodyMail = strBodyMail & "
<Table width=800 cellpadding=0 cellspacing=0 border=0 bordercolor=#FFFFFF><tr><td width=10 valign=top></td><td width=780 valign=top>"
strBodyMail = strBodyMail & "<font size=2 color=#FFFFFF face=Verdana>" & Mittente & "
" & Localita & "
"
strBodyMail = strBodyMail & "Tel." & telefono & "/Cell." & Cellulare & "
E-Mail" & EMail & "
</font></td><td width=10 valign=top></td></tr></table>
"
strBodyMail = strBodyMail & "<Table width=800 cellpadding=0 cellspacing=0 border=0 bordercolor=#FFFFFF><tr><td width=10 valign=top></td><td width=780 valign=top><font size=2 color=#FFFFFF face=Verdana>"
strBodyMail = strBodyMail & "Oggetto:" & Ogg & "</font></td><td width=10 valign=top></td></tr></table><Table width=800 height=25 cellpadding=0 cellspacing=0 border=0 bordercolor=#FFFFFF>"
strBodyMail = strBodyMail & "<tr><td width=800 valign=top></td></tr></table><Table width=800 cellpadding=0 cellspacing=0 border=0 bordercolor=#FFFFFF><tr><td width=10 valign=top></td>"
strBodyMail = strBodyMail & "<td width=780 valign=top><p align=justify><font size=2 color=#FFFFFF face=Verdana>" & Messaggio & "</font></p></td><td width=10 valign=top></td></tr></table></center>"
strBodyMail = strBodyMail & "</td></tr></Table></body></html>"
objMail.HTMLBody = strBodyMail
objMail.Send()
Set objMail = Nothing
Response.Redirect("inviook.asp")
else
Response.redirect("primocontatto.asp?Errore=" & flag)
end if
%>
questa procedura di cdosys esclusa l'apertura del database ovviamente
funziona benissimo sullo stesso sito lą dove io metto:
mentre mettendocodice:objMail.To = "pippo@tin.it"
ossia la variabile che contiene il campo del db mi da errore alla riga 76 che č:codice:objMail.To = Indirizzo
perchč questo!codice:objMail.Send()![]()
:master:
Grazie