c# - How To Test If Hotmail Account Exists? -


I am trying to check if my Hotmail account exists or not, but the following code did not help me .

  Public Bull ISAxist's_MTPP method (string email) {string domain = email.Substring (email.InexexOf ("@") + 1); Var server = _commander.getmxservers (domain); Socket socket = faucet; Forex Currency (MXSverver MX Server in Server) {IPHostentiary IPHost = DNS Resolve (MXSverver MailExchange); IPDPpoint and point = new IPPpoint (IPHOST address list [0], 25); Socket = new socket (endpoint, addressfamily, socket type stream, protocol type. TCP); Socket.Connect (last point); If (! Czech response (socket, resp .num connectivity)) {socket.Close (); } Else {// If connected, send SMTP command {SendData (socket, string.format ("halo {0} \ r \ n", "machinename"); If (! Czech Response (Socket, ResponseNen. GenerisSutus)) {Socket. Stop it (); to continue; } SendData (socket, string.format ("from mail:  \ r \ n", "from@domain.com")); Check Response (Socket, Response Nem. GenericSoot); SendData (socket, string.format ("RCPT to: & lt; {0}> \ r \ n", email)); Bull results = checkers (socket, resp., Generic soot); If (! Result) {socket.Close (); to continue; } And true back; } } } return false; }    

There are many questions on this, and many of them are the same common answer . If you are sending SMTP server, then you can confirm that the email address is present using SMTP commands like RCPT2, VRFY or XPN.

The problem is that it seems that Hotmail should allow this.

The following code works on Gmail (and certifies that there is a user), but you can not use it to authenticate hotmail addresses - their SMTP server is invalid for everything .

  var email = "invalidemailasifnasiofnasonfaso@gmail.com"; TcpClient tClient = new TcpClient ("gmail-smtp-in.l.google.com", 25); String CRLF = "\ r \ n"; Byte [] Datababer; String Response String; NetworkStream Netstream = TCLAT Gatestream (); Streamer reader = new streamreader (netstream); ResponseString = Reader. Readline (); / * Hollow on the SMTP server and get the response * / datababro = bytefreightstring ("Hello Kirtan" + CRLF); Netstream.Write (Databaffer, 0, Databafar. Lang); ResponseString = Reader. Readline (); DataBuffer = ByteFrameString ("From Mail: & lt; test@gmail.com>" + CRLF); Netstream.Write (Databaffer, 0, Databafar. Lang); ResponseString = Reader. Readline (); / * Read the message to know the RCPT from Google if it is present or not * / dataBuffer = ByteFrameString ("RCPT to: << + + + Email +" & gt; "+ CRLF); Netstream.Write (Databaffer, 0, Databafar. Lang); ResponseString = Reader. Readline (); If GetResponseCode (ResponseString) == 550) {Console.WriteLine ("Mail address does not exist"); Console "Lite" ("Basic Error from SMTP Server" + ResponseString); } Else {Console.WriteLine ("Original Response to SMTP Server" + ResponseString); } / * Cleat Connection * / Databaffer = Byteformstrings ("QUITE" + CRLF); Netstream.Write (Databaffer, 0, Databafar. Lang); TClient.Close ();   

And such a thing will allow you to log in to Hotmail SMTP to send an email, but this email will not return or correct until your credentials are correct. Try {SmtpClient SmtpServer = new SmtpClient ("smtp.live.com"); SmtpServer.EnableSsl = true; SmtpServer.UseDefaultCredentials = false; SmtpServer.Port = 587; SmtpServer.Credentials = New System.Net.NetworkCredential ("test@hotmail.com", "password"); Var message = new mail form {from = new mail address ("asd@hotmail.com"), subject = "test"}; Message.To.Add ("sodfinaosidgnoasbeguosebofubasgfsgrsgr@hotmail.com"); SmtpServer.Send (message); } Hold (SmtpException x) {// This unfortunately only actually calls the authentication failure console. WrightLine (x.ToString ()); }

What I would recommend, sending these people an activation link to their email, and if they click it, then it sets their email to verify so that You know you can send them emails. You also need to make sure that you do not send unnecessary email, otherwise you are sending emails in large black holes.

Here are some references to those who have asked this in the past. / P>



Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -