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.

War diese Antwort hilfreich?

 Artikel drucken

Lesen Sie auch

flushing iptables

Posted by hazarus, 09-16-2007, 04:34 AMhello, I keep trying to flush my iptables on my linux...

how protection upload from members {jpg-gif-png} only ?

Posted by 3okl, 09-18-2008, 07:06 PMif member have none photo the uploader start upload anyfile...

adultvideoscript dispute

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

I'm looking for a PHP PDF Invoice Maker Script

Posted by Freekers, 03-06-2007, 01:58 PMHello ! I'm looking for a cheap or free PHP PDF Invoice...

Which server should I buy? (Server spec)

Posted by fusionwebhost, 04-22-2009, 10:57 AMGreetings to everyone on this board. I have...