Hi everyone,
I'm creating a program that verify an email if it exists. I found a code on doing this but when I try using it, the runtime stops "
ResponseString = reader.ReadLine()
" when the program reading the response string.
Below is the code (I just converted this t VB.NET the original code is C#)
Dim server As String = "server.com"
Dim port As Integer = 25
Try
Dim client As New TcpClient(server, port)
Dim CRLF As String = "\r\n"
Dim dataBuffer As Byte()
Dim ResponseString As String
Dim netStream As NetworkStream = client.GetStream()
Dim reader As StreamReader = New StreamReader(netStream)
ResponseString = reader.ReadLine()
dataBuffer = BytesFromString("HELO HI" + CRLF)
netStream.Write(dataBuffer, 0, dataBuffer.Length)
ResponseString = reader.ReadLine()
dataBuffer = BytesFromString("MAIL FROM:mailFrom@server.com" + CRLF)
netStream.Write(dataBuffer, 0, dataBuffer.Length)
ResponseString = reader.ReadLine()
dataBuffer = BytesFromString("RCPT TO:rcptTo@server.com" + CRLF)
netStream.Write(dataBuffer, 0, dataBuffer.Length)
ResponseString = reader.ReadLine()
MsgBox(ResponseString)
dataBuffer = BytesFromString("QUIT" + CRLF)
netStream.Write(dataBuffer, 0, dataBuffer.Length)
client.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Can anyone post why this happens..
Thanks
Still can't find an answer....
The below source is to send, but I want to check if email exists in Mail Server or not...