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.

Byla tato odpověď nápomocná?

 Tisknout tento článek

Také čtěte

VMWare IIS and SSL mystry

Posted by WebGuru72, 07-18-2007, 12:58 AMHello All, I have a very weird problem, I have a...

adultvideoscript dispute

Posted by jo2jo, 03-05-2010, 08:46 PMPlease beware. quick over view, the site says Instant...

Attacking multicore CPUs (new vulnerability discussion from Slashdot/The Register)

Posted by Lightwave, 09-16-2007, 10:02 AMAttacking multicore CPUs...

email from root

Posted by Saryooo, 04-18-2007, 05:39 AMDaily i am getting this kind of emails from my VPS. I...

yum broken

Posted by chielsen, 12-18-2007, 02:20 PMI have waisted all not trying to get subversion working...