'Hai ragione scusa adesso che ho + tempo ti spiego meglio:
'Con questo codice dovresti capire!
'Ti basterà inserire un bottone e chiamarlo "connect".
Dim Receive As String
Dim RecOn As Boolean
Private Sub Connect_Click()
Dim Dati As String
Dim mailfrom, mailto As String 'le ho impostate per esempio.
RecOn = False
ws.Close
'Connettiti...
'consiglio "smtp.aruba.it" come host non richiede l' autentificazione
ws.connect "smtp.aruba.it", 25 'Lascialo cosi per provare!
'mail tua:
mailfrom = "25134" 'Questa lasciala pure per provare!
'mail destinatario:
mailto = "latuaemail@server.it/com" '<-- Qui metti LA TUA E_MAIL per provare!!!!!
LMailFrom:
If RecOn = True Then
MsgBox "1) Il server ha risposto, adesso mando il destinatario"
Dati = "MAIL FROM: " & mailfrom
ws.SendData Dati + vbCrLf
RecOn = False
'Va da solo a LMailTo.
Else
DoEvents
GoTo LMailFrom
End If
LMailTo:
If RecOn = True Then
MsgBox "2) Il server ha risposto, adesso mando il mittente"
Dati = "RCPT TO: " & mailto
ws.SendData Dati + vbCrLf
RecOn = False
MsgBox "Adesso continua tu! Devi inserire il data,ecc..."
Else
DoEvents
GoTo LMailTo
End If
End Sub
Private Sub ws_DataArrival(ByVal bytesTotal As Long)
'Questo è l' evento che riceve:
ws.GetData Receive, vbString 'Cosi ricevo una stringa.
MsgBox "Il server ha risposto: " & Chr(10) & Chr(10) & Receive
RecOn = True
End Sub
'Ciao, fammi sapere come và???![]()
![]()


Rispondi quotando