Ciao a tutti; cerco disperatamente di far spedire un email all'amministratore di una chat nel momento in cui qualcuno si autentica ma non ci riesco e non ritorna nessun errore, soltanto l'amministratore non riceve le comunicazioni... il server è win 2003 e ho seguito le specifiche di cdosys... non so più dove
Ecco il codice:
codice:
<%Response.Buffer=TRUE%>
<%
if request("username") = "" then
response.redirect("login_default.asp")
else
%>
<%
application.lock
newusers = application("totusers")
if application("totusers") = "" then
application("totusers") = 1
newid = 1
else
newid = application("totusers") + 1
application("totusers") = newid
end if
userid = "user" & newid
boxid = "box" & newid
flagid = "flag" & newid
authid = "auth" & newid
updateid = "update" & newid

myid = newid
application("" & userid & "") = request("username")
application("" & boxid & "") = ""
application("" & flagid & "") = "no"
application("" & authid & "") = ""
application("" & updateid & "") = now
response.cookies("newid") = newid
response.cookies("boxid") = boxid
response.cookies("flagid") = flagid
response.cookies("authid") = authid
response.cookies("imlogdin") = "yes"
response.cookies("myid") = myid
response.redirect("messenger.asp")
application.unlock
end if

invioA =  "postmaster@chat.com"
invioDa = "postmaster@chat.com"

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "smtp.aruba.it" 
Flds(cdoSMTPServerPort) = 25
Flds(cdoSMTPAuthenticate) = cdoAnonymous ' 0
Flds("urn:schemas:mailheader:X-Priority").Value = 1
Flds.Update

messaggio = messaggio & VBcrlf & "L'utente[b] " & request("username") & " è entrato in chat

"

With iMsg
   Set .Configuration = iConf
   .To = invioDa
   .From = invioA
   .Sender = invioDa
   .Subject = "Nuovo accesso alla chat"
   .HtmlBody = messaggio
   .Send
End With
%>