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.

هل استفدت من هذا الجواب؟

 أطبع هذا المقال

اقرأ أيضا

which companies use h-sphere?

Posted by salsabil, 08-16-2002, 05:47 AMHeya Could people give me which (good) hosting...

Cannot open database asp.net

Posted by Faiyaz, 09-22-2008, 03:02 PMCannot open database "DATABASENAME" requested by the login....

Need PHP5 Developer for open source web game project

Posted by openwars, 01-16-2008, 04:54 PMHello hxxp://sf.net/projects/modulargaming is our...

Linux: backup hard drive mounted to /backup

Posted by UberTricep, 11-10-2012, 07:49 AMI have a new dedicated server and I ordered a backup...

kernel exploit!

Posted by tkanaco, 06-27-2008, 11:27 PMHow Can i translate An Kernel Exploit to secure my server...