In Command1Click() you need t change the username and password and the smtp server.Although some servers allow you to send messages thru them even if the from email account doesnt really exist.When you open the files, theyll open in the default email client, Outlook Express, or something.This example will leave a copy of the message still on the server.
Using Winsock Password And TheIf you want to delete the message simply add sendMsg DELE a after the RETR command in cmdCheckMailClick(). In general Declarations Dim received As Boolean Dim Message Dim sckError Private Sub Winsock1DataArrival(ByVal bytesTotal As Long) Winsock1.GetData Message Select Case Winsock1.Tag Case RETR Put 1,, Message If InStr(Message, vbLf. Since all you can do with winsock is far beyond the scope of. And now, lets get right into the core of winsock programming. Well see some of these commands in greater details in the example. It is a requestresponse protocol between clients and servers. Whether you are receiving or sending mail, this will be the protocol. In the next section well talk about it however, well limit ourselves to just what we need for this tutorial or the next section would be. There is also the winsock2.bi file which stands at a whopping 48kb. Some of the names here are quite ambiguous and in my opinion could have been given much better and clearer names than those used here. However, for the sake of this tutorial, once again, I merely included. Youll notice they are quite empty (1 line each) and well I thought Id explain why I didnt just use the WS related functions themselves. In your projects, you might need to create variables, assign some values, to different things before you execute your task and keeping this initialization material in one function is a great. But again, my style is my style and youre more than welcome to use it, or not, depends. Using Winsock Code You MayAll it does now is declare a variable called Connection of type LONG, calls the StartSockets() function (with whatever initialization code you may need), calls the ConnectToURL() function which performs the actual task and finally calls the EndSockets() function to close whats been opened (and release resources as needed by your projects). This program will perform the intended work which is to connect to and display information and contents about the URL. ![]() Using Winsock Download The FileDont worry, you dont have to type (or cut and paste) all that in, heres a link to the sockets.bas so you can just download the file and compile it for yourself. I think that as an introduction, it covered alot of grounds and gave you a good start on your own winsock projects. As far as winsock itself is concerned, the functions needed are all present in winsock.bi and winsock2.bi. ![]() However, theres no denying the necessity of winsock programming whetehr you are creating an online game, or an application that can really benefit from a connection to some online resource. Ill be happy to answer questions, and bring suggestions and help to your winsock projects as well.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |