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.

Дали Ви помогна овој одговор?

 Испечати

Исто така прочитајте

How to call/load .net dll(C#) from c++ code?

Posted by TajByte, 03-22-2007, 04:50 AMHow to call/load .net dll(C#) from c++ code? Posted...

Unable to change the file attribute

Posted by tuxican, 09-14-2007, 12:09 PMHi all, I am not able to change the attribute of a...

FTP Question - Limiting types of Access

Posted by webtender, 03-29-2008, 11:17 PMHello, Is it possible to setup ftp accounts that have...

Disk IO performance

Posted by diskio, 03-26-2008, 08:03 PMFrom the Disk I/O performance is it better 1) to have main...

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