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.

Was this answer helpful?

 Print this Article

Also Read

Custom nameservers question

Posted by emmzee, 09-14-2007, 08:47 PMHi everyone, (x.com = replacement for my actual domain) I...

Can't upload via php script

Posted by JohnDoe_Cro, 06-28-2008, 01:58 PMHello all, I am having problems on my server... I...

what could be the problem ?

Posted by jjk2, 06-26-2008, 03:13 AMi am experiencing some strange thing. i have to reload a page...

Hosting Related Press Releases

Posted by SoftWareRevue, 04-29-2009, 10:30 AM Post your press release for the WHT community...

mySQL Caching

Posted by jweeb, 03-10-2010, 10:54 PMHi All, I am new to this. I would like to do a mySQL...