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.

Esta resposta lhe foi útil?

 Imprimir este Artigo

Veja também

When blog works forums stops working and viceversa

Posted by sash_007, 03-10-2010, 08:47 PMHello friends, I am having a weird problem my problem is...

Booting from external HDD

Posted by Danny159, 03-30-2008, 07:54 AMHey, I want to install Linux Ubuntu onto it, the thing...

Free script that hides links?

Posted by bambinou, 11-12-2012, 04:29 AMHello, I would like to know if you have ever seen a...

WHM/Cpanel Exim issue - how to better secure a partially open relay

Posted by MnMNmN, 02-14-2008, 10:04 PMHi all, I have a WHM/CPanel server. I have done some...

How can I detect what country is the visitor from?

Posted by bx510, 09-18-2008, 10:46 PMI need to detect where the visitor is coming from on my...