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.

¿Fue útil la respuesta?

 Imprimir éste Artículo

Leer también

WordPress sitemap plugin problem or no ?

Posted by SimonDevise, 11-06-2012, 05:25 AMI have use WordPress sitemap plugin 2-3 month, but I...

Sanitize issues i think

Posted by rumrunner439, 09-22-2008, 12:22 AMOk Im over having to rename everything in my computer...

looking for a PHP/Opensource Voting/poll system..

Posted by CyberHostPro, 08-16-2011, 07:49 AMHello I have told a local charity i'll help them...

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...

How to perform an FSCK

Posted by mark1hos, 09-16-2007, 02:52 PMHi guys, we've got our server hooked up to a KVM, as the...