Ciao,
Non riesco a capire come mai l' e-mail inviatami con il codice che segue mi arriva ma priva di mittente, destinatario, e corpo:
codice:
Dim Reciever As Boolean
Dim Sender As Boolean
Dim MailStat As Boolean
Dim SendStat As Integer
Dim MailServer As String
Private Sub Command1_Click()
GetReady
Winsock1.Connect MailServer, 25
SendStat = 1
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
txtrecieve.Text = "giorgio@modatex.it"
txtsender.Text = "giobex@libero.it"
txtsubject.Text = "test oggetto"
txtmessage.Text = "ci proviamo di nuovo"
End Sub
Private Sub Form_Load()
MailServer = "ceisystems.it"
Reciever = False
Sender = False
GetReady
End Sub
Private Sub txtRecieve_GotFocus()
If Reciever = False Then
txtrecieve.Text = ""
Reciever = True
End If
End Sub
Private Sub txtSender_GotFocus()
If Sender = False Then
txtsender.Text = ""
Sender = True
End If
End Sub
Function GetReady()
Do While Winsock1.State <> sckClosed
DoEvents
Winsock1.Close
Loop
End Function
Private Sub Winsock1_Connect()
txtstatus.Text = "Connected.." & vbNewLine
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Data As String
Winsock1.GetData Data
txtstatus.SelLength = Len(txtstatus.Text)
txtstatus.SelText = Data
Select Case SendStat
Case 1
Winsock1.SendData "HELO yahoo.com" & vbCrLf
Case 2
Winsock1.SendData "MAIL FROM: " & txtsender.Text & vbCrLf
Case 3
Winsock1.SendData "RCPT TO: " & txtrecieve.Text & vbCrLf
Case 4
Winsock1.SendData "DATA" & vbCrLf
Winsock1.SendData "subject: " & txtsubject.Text & vbCrLf
Winsock1.SendData txtmessage.Text & vbCrLf
Case 5
Winsock1.SendData vbCrLf & "." & vbCrLf
Case 6
Winsock1.SendData "QUIT" & vbCrLf
End Select
SendStat = SendStat + 1
End Sub