Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Winsock
Message
 
To
15/09/2004 00:56:45
Bhavesh Desai
Apex Softcell (India) Pvt. Ltd.
India
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00942248
Message ID:
00942460
Views:
16
What do you want to do with winsock? The following example sends email. I have a few more examples. Send me an email and I email you the zip.
#define sckClosed 0
#define sckOpen 1
#define sckListening 2
#define sckConnectionPending 3
#define sckResolvingHost 4
#define sckResolved 5
#define sckConnecting 6
#define sckConnected 7
#define sckClosing 8
#define sckError 9

#DEFINE crlf CHR(13)+CHR(10)

thisform.tcpClient.Protocol = 0     && 0=TCP Protocol, 1=UDP
thisform.tcpClient.RemoteHost = "mailserver.dsigroup.com"
thisform.tcpClient.RemotePort = 25 && smtp port.
ThisForm.tcpClient.Object.Connect()
WAIT WINDOW '' TIMEOUT .1 
nn = 0
checkLop =20
DO WHILE ThisForm.tcpClient.Object.State <> 7 AND checkLop<nn
   nn = nn+1
ENDDO 

thisform.tcpClient.Object.senddata("HELO 10.1.1.150" + crlf)
thisform.tcpClient.Object.senddata("craigmoore@dsigroup.com" + crlf)
thisform.tcpClient.Object.senddata("Mail From:"+lcFrom + crlf)
thisform.tcpClient.Object.senddata("RCPT TO:" + lcTo + crlf)
=Inkey(.001)
thisform.tcpClient.Object.senddata("DATA" + crlf)
thisform.tcpClient.Object.senddata("From:" + lcFrom + crlf)
thisform.tcpClient.Object.senddata("To:"+ lcTo + crlf)
thisform.tcpClient.Object.senddata("Subject:"+lcSubject + crlf)
thisform.tcpClient.Object.senddata(crlf + lcText + crlf)
thisform.tcpClient.Object.senddata("." + crlf)
=Inkey(.001)
thisform.tcpClient.Object.senddata("QUIT")
>Hi,
>
> We are developing an Alert System using winsock. However where can i find out more information about using socket with vfp ? How to trap errors if connection is not established etc. ?
>
>Regards.
>
>Bhavesh
- Jayesh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform