I wanted to write a simple mail program, but could not. In the WinSock help it describes weakly. Where there is a description, manual or sample how to send the letter (simple text, without pictures), how to view the list of the incoming letters and how to accept them? Thanks to everybody who help me. Mike.
Posted on 2001-05-06 05:12:00 by Mike
You'll have to take a look at the mail protocols, POP3 and SMTP. Search for both at rfc-editor.org. The protocols are quite simple and fully text based. It's too much to explain here but a simple example of sending a mail: (> is outgoing, < is incomming) connect to SMTP server on port 25 <220 blah server blah >HELO yourhostiporsomehthingelse <250 servername Hello .... >MAIL FROM: someone@something.com <250 is syntactically correct >RCPT TO: receiver@something.com <250 is syntactically correct >DATA <354 Enter message, ending with "." on a line by itself >From: someone >To: someone else >Subject: test mail > >Here's your mail. >Regards, >Someone >. <250 OK id=2321218392892 The first three numbers of every repsonse indicate the success or failure of a command. The text after the number can be anything, you can't rely on that (but that just makes it easier). Thomas
Posted on 2001-05-06 05:37:00 by Thomas
If you want to read your mail, you will have to code an application that uses the POP3 protocol. Your application should connect to a pop3 server, then send commands like USER (to login to the server), PASS (to send a password) or RETR (to retrieve mail). All the commands are described in the POP3 RFC (you can find it at www.ietf.org) To send mail, you will have to use the SMTP protocol. Good luck!
Posted on 2001-05-06 05:52:00 by karim
There is a full program which demos use of winsock and sending email with code on my site (Simple Mailer) http://james.ezylink.net.au James
Posted on 2001-05-07 23:02:00 by James