question

sabrysabry-7040 avatar image
0 Votes"
sabrysabry-7040 asked RitaHu-MSFT commented

i can not connect the mail server of yahoo on port 25

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 67.195.204.77:25

this is my code
TcpClient tclient = new TcpClient();
tclient.Connect(emailserverip,25);
Label4.Text = "server is connected ";
string CRLF = "\r\n";
byte[] dataBuffer;
string ResponseString;

                                 NetworkStream netstream = tclient.GetStream();
                                 StreamReader sr = new StreamReader(netstream);
                                 ResponseString = sr.ReadLine();

                                 /* Perform HELO to SMTP Server and get Response */
                                 dataBuffer = BytesFromString("HELO" + CRLF);
                                 netstream.Write(dataBuffer, 0, dataBuffer.Length);
                                 ResponseString = sr.ReadLine();
                                 //sender mail 
                                 dataBuffer = BytesFromString("MAIL FROM:<Check@" + host + ">" + CRLF);
                                 netstream.Write(dataBuffer, 0, dataBuffer.Length);
                                 ResponseString = reader.ReadLine();
                                 /* Read Response of the RCPT TO Message to know mailbox if it exist or not */
                                 dataBuffer = BytesFromString("RCPT TO:<" + email + ">" + CRLF);
                                 netstream.Write(dataBuffer, 0, dataBuffer.Length);
                                 ResponseString = reader.ReadLine();
                                 if (GetResponseCode(ResponseString) == 550)
                                 {
                                     continue;
                                 }
                                 else
                                 {
                                   Label5.Text = "GOOD";

                                 }
                                 /* QUITE CONNECTION */
                                 dataBuffer = BytesFromString("QUITE" + CRLF);
                                 netstream.Write(dataBuffer, 0, dataBuffer.Length);
                                 tclient.Close();
windows-server-update-services
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I found there are several Internet address of yahoo. Could we try to the other address to test:
Reference picture:
82258-9.png

In addition, I found a related link for your reference.

Regards,
Rita


0 Votes 0 ·
9.png (149.4 KiB)

0 Answers