PDA

Click to See Complete Forum and Search --> : winsock help


xstopx81
Aug 31st, 2000, 01:56 PM
Public Sub Wait(WaitTime)

Dim StartTime As Double

StartTime = Timer

Do While Timer < StartTime + WaitTime
If Timer > 86395 Or Timer = 0 Then
Exit Do
End If
DoEvents
Loop

End Sub

above is my code to wait ... if i dont put this inbetween the senddata function, my winsock doesn't send the data necessary. But all of the codes work fine, just the fact that it doesn't send!!! here's my sending code



Wait 0.5

wsk.SendData "EHLO " & wsk.LocalIP & vbCrLf
wsk.SendData "MAIL FROM:" & strFrom & vbCrLf

Wait 0.5

wsk.SendData "RCPT TO:" & strTo & vbCrLf
wsk.SendData "DATA" & vbCrLf

Wait 0.5

wsk.SendData "MIME-Version: 1.0" & vbCrLf
wsk.SendData "From: " & ExtractArgument(1, strFrom, "@") & " <" & strFrom & ">" & vbCrLf
wsk.SendData "To: <" & strTo & ">" & vbCrLf
wsk.SendData "Subject: " & strSubject & vbCrLf
wsk.SendData "Content-Type: multipart/mixed;" & vbCrLf
wsk.SendData " boundary=Unique-Boundary" & vbCrLf & vbCrLf
wsk.SendData " [ Random garbage here ]" & vbCrLf & vbCrLf
wsk.SendData vbCrLf & "--Unique-Boundary" & vbCrLf
wsk.SendData "Content-type: text/plain; charset=US-ASCII" & vbCrLf & vbCrLf
wsk.SendData strBody.Text & vbCrLf & vbCrLf

wsk.SendData vbCrLf & "." & vbCrLf

Wait 0.5

wsk.SendData "QUIT" & vbCrLf

Wait 0.5

wsk.Close

xstopx81
Aug 31st, 2000, 04:02 PM
vb says method not found when i use the code Winsock1.StillExecuting... help

parksie
Aug 31st, 2000, 04:08 PM
Oh crap...I'm not thinking straight. That's for the Internet Transfer Control :(. Ignore that...


While Winsock1.State = sckConnected
DoEvents
Wend