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.

Помог ли вам данный ответ?

 Распечатать статью

Также читают

Need Shell script to add prefix to multiple files' name.

Posted by viettechorg, 03-25-2007, 02:09 PMHello, Does anyone know any of the shell script(or...

Limit concurrent users in MySQL

Posted by ThaiZone, 01-15-2008, 02:49 AMI try to search and not found the solutions to limit...

.htaccess to *.com/index.php/example

Posted by shally87, 03-12-2010, 02:36 PMI am using wordpress and currently i have problem with...

I was thinking...

Posted by Kevin Teoh, 09-21-2001, 10:05 AMI'd like a reseller account where I can give accounts...

Intel Xeon Processor??

Posted by SharonB, 03-30-2008, 02:25 PMGood Day to all of you.. Hmm.. Well I'm just new here in...