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

Hosting Related Press Releases

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

Can some explain this in a simple way?

Posted by subhash, 02-21-2011, 07:52 AMHello Guys, Can some body explain what exactly is...

Error when editing dns Zone

Posted by htw_Mehdi, 06-27-2008, 10:33 AMHello, when i try to edit a DNS zone on WHM i got the...

Domain parking with Win2k3 DNS??

Posted by bloodsport, 08-03-2007, 09:47 AMHi, i have about 8 different domains i'd like to point...

Custom nameservers question

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