December 27th, 2002, 12:05 AM
C code that follows SMTP protocol
I need C sample code that follows SMTP Protocol to send an email in windows as well as Linux.
Need some one to help me on this?
December 27th, 2002, 09:12 AM
Here's a sample SMTP session:
Now all you have to do is to write socket code which runs on windows and linux (which isn't hard at all, you just need to include
different header files and initialize the winsock library
And please don't bitch me about my c code, it has nearly no error handling, no buffer length checking, no mail server reply checking, ... but it works...sometimes ;-)
December 27th, 2002, 12:08 PM
Good luck. Windows and UNIX have very different approaches to the network. Under UNIX systems it is traditional to do a popen on mail or sendmail. A good example can be found at The Unix Programming Resources Page
I don't know of any libraries for Windows that do this. Certainly they're available commercially. If you're in need of something capable of cross-compiling though I think you could be out of luck.
Articles and commentary on web development
December 28th, 2002, 12:33 AM
smtp c code
I compiled the file you sent in linux and executed it.
But its giving the message as "Mail successfully sent."(for our local mail server),but at the other end we are unable to receive the mail.
And while trying to send mails to few servers like yahoo.com,hotmail.com etc its giving error
" failed to send mail with code -2"