· 10 years ago · Mar 05, 2016, 04:15 PM
1'Coded by ArsenicVB
2Function CheckGmail(ByVal raw_email As String) As Boolean
3 Dim email As String = raw_email
4 If Not raw_email.ToLower.EndsWith("@gmail.com") And Not raw_email.ToLower.EndsWith("@googlemail.com") Then
5 email += "@gmail.com"
6 End If
7 Dim stream As System.Net.Sockets.NetworkStream
8 Dim streamw As System.IO.StreamWriter
9 Dim streamr As System.IO.StreamReader
10 Dim client As New System.Net.Sockets.TcpClient
11 Try
12 client.Connect("aspmx.l.google.com", 25)
13 If client.Connected Then
14 stream = client.GetStream
15 streamw = New System.IO.StreamWriter(stream)
16 streamr = New System.IO.StreamReader(stream)
17 Try
18 streamr.ReadLine()
19 streamw.WriteLine("HELO")
20 streamw.Flush()
21 streamr.ReadLine()
22 streamw.WriteLine("MAIL FROM:<example@example.com>")
23 streamw.Flush()
24 streamr.ReadLine()
25 streamw.WriteLine("RCPT TO:<" + Email + ">")
26 streamw.Flush()
27 Dim response As String = streamr.ReadLine
28 streamw.WriteLine("quit")
29 streamw.Flush()
30 streamr.ReadLine()
31 If response.Contains("OK") Then
32 Return True
33 Else
34 Return False
35 End If
36 Catch
37 MsgBox("Befehle konnten nicht gesendet werden!")
38 Return False
39 End Try
40 Else
41 MsgBox("Verbidnung konnte nicht aufgebaut werden!")
42 Return False
43 End If
44 Catch
45 MsgBox("Verbidnung konnte nicht aufgebaut werden!")
46 Return False
47 End Try
48 End Function