Sending commands to a socket (C++)

Posted by LindonNetworks, 09-19-2008, 05:53 PM
I'm trying to write an SMTP wrapper and I'm connecting to the mail server with winsock and connect successfully but how do I send the commands? send(lhSocket,"HELO\\r",strlen("HELO\\r"),0); Does it need to be \n to end the command?

Posted by DigitalLinx, 09-20-2008, 08:22 AM
You're escaping the return with \\r, return (\r) and newline (\n) are a bit different you might want to use both like this Also note that strlen() returns when it hits a NULL character, it might be a better idea to use sizeof() in this case. Last edited by DigitalLinx; 09-20-2008 at 08:26 AM.

這篇文章有幫助嗎?

 列印本文

Also Read

Soap

Posted by parag, 03-12-2010, 09:58 AMHello, I installed SOAP - which tells me it has installed...

Seem Internet Solutions gone down?

Posted by Jollyjohn, 09-11-2001, 07:41 PMwww.seem.co.uk appear to have disappeared, taking my...

Warning: shell_exec() has been disabled for security reasons

Posted by ashish1987, 09-15-2007, 12:39 AMHey I installed status2k on my server and i am...

*****

Posted by OverSkilled, 09-30-2001, 01:27 PMHi, I'm starting a reselling business also. I'm gonna...

multi line edit with php and mysql

Posted by recklessop, 01-15-2008, 09:54 PMDoes anyone know of an example of a php mysql script....