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.

Cette réponse était-elle pertinente?

 Imprimer cet article

Consultez aussi

Newbie setting up LAMP (Fedora 7)

Posted by r557, 09-16-2007, 02:54 PMLooking for some good information that would help me get my...

I was thinking...

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

Disk IO performance

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

MySQL database convert!

Posted by tetrahost, 11-14-2012, 03:25 AMHello all, i need a help from you. i need to convert a...

a line in my crontab

Posted by cannibal, 01-13-2008, 05:50 AMhello I found this line in my crontab file 0...