1

basically i have to run in cmd.exe the following commands on C#(if you run it on CMD, it'll work) this link explains better

nslookup -type=mx emailProvider.com //for exemplo nslookup -type=mx hotmail.com.com

after it retun this:

Server:  ip-172-31-0-2.sa-east-1.compute.internal
Address:  172.31.0.2

Non-authoritative answer:
hotmail.com     MX preference = 5, mail exchanger = mx1.hotmail.com
hotmail.com     MX preference = 5, mail exchanger = mx2.hotmail.com
hotmail.com     MX preference = 5, mail exchanger = mx3.hotmail.com
hotmail.com     MX preference = 5, mail exchanger = mx4.hotmail.com

so I take some mail exchanger, for exemplo:

telnet mx1.hotmail.com 25 //port 25

after I nedd write "HELO" for exemplo:

HELO 

so finilly I write :

mail from:<michele@sacapp.net>
rcpt to:<michele_labriola@hotmail.com>//email verificate

so it return a number, 250 or 550, if 250 the email don't exist, else it exists

I tried use the minimalistic Tel net , I tried Process to write lines command windows but nothing of this working, it just work before helo, when I write helo it's don't work but it's working on CMD

some on can help me please?

sorry for my bad english

Thank you!

Italo José
  • 1,558
  • 1
  • 17
  • 50
  • 1
    "when I write helo it's don't work" Doesn't work like it throws an exception? Formats your hard drive? Steals your girlfriend? :) Can you be more specific? What do you *expect* to happen, and what *actually* happens. – aquinas Aug 15 '16 at 19:51
  • return anything, basically I wnat to do it [link](https://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/) but on c# – Italo José Aug 15 '16 at 19:53
  • There was special SMTP command `VRFY` for that purpose. In newer SMTP versions it was denied because can be used for spam. `VRFY smith` and you get info "we have such account" or not. – i486 Aug 15 '16 at 19:59
  • There are few open SMTP servers these days. I'd say run your own to before it is not protected with a password or some other authentication. – Hogan Aug 15 '16 at 20:00
  • The SMTP server doesn't need to be open. It just needs to be the SMTP server responsible for the domain since it will accept mail for its local accounts. Certainly, it won't do relaying, but that's not the OP's intent. – Andreas Aug 15 '16 at 20:01
  • do you know do it on codes? my problem is the codes, if I do it on cmd.exe it's working, but when I write the commands on cmd.exe by C# it doesn't work – Italo José Aug 15 '16 at 20:05

1 Answers1

1

Good question, POOR solution.

You are attempting to query the SMTP server to see if an email exists. I highly recommend you don't do this, because your external IP address will end up on a blacklist and you'll be unable to send any mail!

You don't need to call an external telnet process to communicate with a SMTP server. You can use a TcpClient instance. Examples: this, and this.

Community
  • 1
  • 1
Xavier J
  • 4,326
  • 1
  • 14
  • 25