這個 script 是使用 expect 作的,也需要 telnet 指令
基本上就是用 telnet 驗證有沒有這樣子而已
編輯 check_email_verify.exp 檔,內容如下
#!/usr/bin/expect # # 檢查 email 存不存在 # need expect and telnet command # set timeout 60 set mx [lindex $argv 0] set em [lindex $argv 1] spawn telnet $mx 25 expect "220" send "EHLO $mx\n" expect "250 " send "MAIL FROM: <$em>\n" send "RCPT TO: <$em>\n" expect -re "450|550|2.1.5|ecipient.*ok" send "QUIT\n"
執行如下指令
mailserver 帳號 expect check_email_verify.exp mail.ssorc.tw [email protected]
成功的話就會是這樣子
spawn telnet mail.ssorc.tw 25 Trying xx.xx.xx.xx... Connected to mail.ssorc.tw. Escape character is '^]'. 220 XXXXXXXXX EHLO mail.ssorc.tw 250-XXXXXXXXX Hello [xx.xx.xx.xx] 250-SIZE 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-X-ANONYMOUSTLS 250-AUTH NTLM 250-X-EXPS GSSAPI NTLM 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250-XEXCH50 250-XRDST 250 XSHADOW MAIL FROM: <[email protected]> RCPT TO: <[email protected]> 250 2.1.0 Sender OK 250 2.1.5 Recipient OK
有找到一個網頁 http://verify-email.org/ 也可以作這種事
MX record about ssorc.tw exists. Connection succeeded to mail.ssorc.tw SMTP. 220 XXXXXXXXX > HELO verify-email.org 250 ssorc.tw Hello [verify-email.org] > MAIL FROM: <[email protected]> =250 2.1.0 Sender OK > RCPT TO: <[email protected]> =250 2.1.5 Recipient OK
留言
Hi! Try Zerobounce.net for email validation. They are the most secure and accurate email validation system you can find. Here is the link where you can find them https://www.zerobounce.net
你好,我是一個完全不懂語言的人, 但由於公司發信需要驗證出email是否有效, 想請問如何測試? 因為我連這段語言我都不知道要打在哪裡, 麻煩您了
我補充了文章,你再試試,如果還不是行,可以試文章下面提到的線上版的