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.

Hjalp dette svar dig?

 Print denne artikel

Læs også

disable php functions?

Posted by Calibaba, 09-15-2007, 06:28 PMDoes the below look good for a private server (linux,...

yum broken

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

SVN web interface

Posted by fqaisrani, 02-21-2011, 10:17 AMI want to install SVN server on my VPS along with a web...

sdb instead of sda -> Help needed

Posted by CoolMike, 07-17-2007, 03:23 AMHi I have a server with a raid5 configuration. Linux...

Object Oriented Programming in PHP

Posted by That Guy, 03-19-2007, 11:03 PMWhy? I want to make a login script, but I'm not sure if I...