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.

Var dette svaret til hjelp?

 Print

Les også disse

Editting the default web page using SSH

Posted by MrDGOrman, 03-09-2010, 09:44 AMThis might be in the wrong section - if so, ma bad....

Delete files created on a specific date

Posted by Acroplex, 06-28-2008, 08:16 PMIs there a quick shell command to find (inside a...

litespeed standard 150 connect limit, high enough?

Posted by aww, 05-04-2007, 03:12 PMHow can I tell if the 150 connection limit in 3.1 litespeed is...

Trouble Enabling DMA Mode on IDE Drive

Posted by GriffinRUN, 04-23-2009, 12:14 AMI cannot enable DMA mode on /dev/hda when attemping to...

Changing File ext. to File

Posted by haleyhosting_com, 03-24-2007, 01:31 PMi have a site upithere.com . its a pretty popular...