Home > Software engineering >  A C email program RCPT without any reply, refer to what reason be
A C email program RCPT without any reply, refer to what reason be

Time:10-10

Has been a problem for a long time, I a small program, is TO use c + + achieve the function of email sent, with 163 server, using the SMTP protocol, MAIL reply after 350 ok, says the MAIL is successful, but no return after the RCPT TO information, which is why ah, here is a small piece of code

 
Sprintf (buf, "MAIL FROM: & lt;" "18252065015 @163.com" "& gt; \r\n");

//send (sockfd, "E-mail from: & lt;" "18252065015 @163.com" "& gt; \ r \ n ", 150, 0);

Send (sockfd, buf, strlen (buf) + 1, 0).

Memset (rbuf, 0150);

The recv (sockfd, rbuf, 1500, 0);

Cout<" Set the Mail From the Receive: "& lt;
//RCPT TO the first recipient
Sprintf (buf, RCPT TO: & lt; "" "18252065015 @163.com" "& gt; \r\n");
//sprintf (buf, "RCPT, & lt; % s> \ r \ n ", email);

//send (sockfd, buf, strlen (buf) + 1, 0).
Int ab=send (sockfd, buf, strlen (buf) + 1, 0).

Memset (rbuf, 0150);

The recv (sockfd, rbuf, 1500, 0);

Cout<" Tell Sendto Receive: "& lt;


Then the output of the program here is:


CodePudding user response:

Come and great spirit to solve, is after RCPT, the server is not responding, or format is wrong, but the format is not so

CodePudding user response:

Control protocol, and then is caught, see what's wrong

CodePudding user response:

Nobody can help you help yourself

CodePudding user response:

Caught? Don't know how to catch,,,
  • Related