Вот логи из сервера
- Код: Выделить всё
!-<13/10 16:48:56 [10.5.80.135:2068<25] (t1 23) <220 10.5.80.135 Simple Mail Transfer Service Ready
!->13/10 16:48:56 [10.5.80.135:2068>25] (t1 24) >HELO 10.5.80.135
!-<13/10 16:48:56 [10.5.80.135:2068<25] (t1 25) <250 10.5.80.135
!->13/10 16:49:03 [10.5.80.135:2068>25] (t1 26)
Error: Timeout
Т.е. прога не получает ответ 250 от сервера....
- Код: Выделить всё
Private Sub Command1_Click()
Winsock1.Close
STATUS = 100
Winsock1.Protocol = sckTCPProtocol
Winsock1.Connect "10.5.80.135", 25
Timer1.Enabled = True 'ВКЛЮЧАЮ ТАЙМЕР В КОТОРОМ timeout = True через 5 сек
While Not Winsock1.State = 7 'ждем подключения
If timeout = True Then GoTo 100
DoEvents
Wend
Label4 = Label4 & vbCrLf & "Соединение оустановлено"
Winsock1.SendData "HELO 10.5.80.135" & vbCrLf
'|||||||||||||||||||~~~~~~~||||||||||||||||||||||
100 Timer1.Enabled = False
If timeout = True Then
Label4 = Label4 & vbCrLf & "ТАЙМ АУТ"
Else
End If
timeout = False
'|||||||||||||||||||~~~~~~~||||||||||||||||||||||
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Winsock1.GetData DATA
If InStr(DATA, "250") > 0 And STATUS = 100 Then
Label4 = Label4 & vbCrLf & DATA
DATA = ""
Winsock1.SendData "MAIL FROM: <" & Text1 & ">" & vbCrLf
STATUS = 1
End If
If InStr(DATA, "250") > 0 And STATUS = 1 Then
Label4 = Label4 & vbCrLf & DATA
DATA = ""
Winsock1.SendData "RCPT TO: <" & Text2 & ">" & vbCrLf
STATUS = 2
End If
If InStr(DATA, "250") > 0 And STATUS = 2 Then
Label4 = Label4 & vbCrLf & DATA
DATA = ""
Winsock1.SendData "DATA" & vbCrLf
STATUS = 3
End If
If InStr(DATA, "354") > 0 And STATUS = 4 Then
Label4 = Label4 & vbCrLf & DATA
DATA = ""
Winsock1.SendData "From: <" & Text1 & ">" & vbCrLf
Winsock1.SendData "To: <" & Text1 & ">" & vbCrLf
Winsock1.SendData "Subject: " & Text4 & vbCrLf & vbCrLf & vbCrLf & vbCrLf
Winsock1.SendData Text3 & vbCrLf & vbCrLf
Winsock1.SendData vbCrLf & vbCrLf
STATUS = 5
End If
If InStr(DATA, "250") > 0 And STATUS = 5 Then
Label4 = Label4 & vbCrLf & DATA
DATA = ""
Winsock1.SendData "QUIT" & vbCrLf
STATUS = 6
End If
If InStr(DATA, "250") > 0 And STATUS = 6 Then
Label4 = Label4 & vbCrLf & DATA
DATA = ""
End If
End Sub