About the MX Record Entry of particular hotmail,yahoomail and rediffmail provider

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GAURAV MANUSMAR
    New Member
    • Feb 2014
    • 8

    #1

    About the MX Record Entry of particular hotmail,yahoomail and rediffmail provider

    I am designing one web page which checks the existence of the Email Address on the server

    For that I have the following code.....this code checks the the existence of gmail address for

    e.g xxxx@gmail.com on the Gmail server

    so can anyone please tell me what is the MX Record Entry of Hotmail,Yahooma il and Rediffmail provider.

    Code:
    TcpClient tClient = new TcpClient("gmail-smtp-in.l.google.com", 25);
    
         string CRLF = "\r\n";
         byte[] dataBuffer;
         string ResponseString;
        NetworkStream netStream = tClient.GetStream();
         StreamReader reader = new StreamReader(netStream);
        ResponseString = reader.ReadLine();
        /* Perform HELO to SMTP Server and get Response */
         dataBuffer = BytesFromString("HELO KirtanHere" + CRLF);
         netStream.Write(dataBuffer, 0, dataBuffer.Length);
         ResponseString = reader.ReadLine();
        dataBuffer = BytesFromString("MAIL FROM:<YourGmailIDHere@gmail.com>" + CRLF);
         netStream.Write(dataBuffer, 0, dataBuffer.Length);
         ResponseString = reader.ReadLine();
        /* Read Response of the RCPT TO Message to know from google if it exist or not */
         dataBuffer = BytesFromString("RCPT TO:<"+TextBox1.Text.Trim()+">"+CRLF);
         netStream.Write(dataBuffer, 0, dataBuffer.Length);
        ResponseString = reader.ReadLine();
        if (GetResponseCode(ResponseString) == 550)
        {
            Label1.Visible = true;
            Label1.Text = "Mai Address Does not Exist !";
            Label1.Text = "<font color='red'>Original Error from Smtp Server :</font>" + ResponseString;
            //Response.Write("Mai Address Does not Exist !<br/><br/>");
            //Response.Write("<B><font color='red'>Original Error from Smtp Server :</font></b>" + ResponseString);
        }
        else
        {
            Label1.Visible = true;
            Label1.Text = "exist";
            //Response.Write("valid address");
        }
        /* QUITE CONNECTION */
         dataBuffer = BytesFromString("QUITE" + CRLF);
         netStream.Write(dataBuffer, 0, dataBuffer.Length);
         tClient.Close();
     }
     private byte[] BytesFromString(string str)
     {
         return Encoding.ASCII.GetBytes(str);
     }
    private int GetResponseCode(string ResponseString)
     {
         return int.Parse(ResponseString.Substring(0, 3));
     }
Working...