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.

Was dit antwoord nuttig?

 Print dit artikel

Lees ook

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

Call Script that Deletes Logs after Stats Run Manually?

Posted by thewird, 01-15-2008, 02:04 AMI'm trying to create a script to archive logs for 7 days...

Delete files created on a specific date

Posted by Acroplex, 06-28-2008, 08:16 PMIs there a quick shell command to find (inside a...

Custom nameservers question

Posted by emmzee, 09-14-2007, 08:47 PMHi everyone, (x.com = replacement for my actual domain) I...

3-line PHP chat

Posted by Looie, 01-15-2008, 03:28 PMJust an idea I had http://www.ehwtf.com/stuffz/chat...