Email SMTP validator

前端 未结 7 1926
太阳男子
太阳男子 2020-12-01 14:48

I need to send hundreds of newsletters, but would like to check first if email exists on server. It\'s called SMTP validation, at least I think so, based on my research on I

7条回答
  •  执念已碎
    2020-12-01 14:55

    SMTP is a text based protocol carried over TCP/IP.

    Your validation program needs to open a TCP/IP connection to the server's port 25 (SMTP), write in a few lines and read the answer. Validation is done (but not always) on the "RCTP TO" line and on the "VFRY" line.

    The SMTP RFC describes how this works (see Green@Beta.ARPA below, S are lines sent by the client, R are lines received from the server):

    Example of the SMTP Procedure
    
             This SMTP example shows mail sent by Smith at host Alpha.ARPA,
             to Jones, Green, and Brown at host Beta.ARPA.  Here we assume
             that host Alpha contacts host Beta directly.
    
                S: MAIL FROM:
                R: 250 OK
    
                S: RCPT TO:
                R: 250 OK
    
                S: RCPT TO:
                R: 550 No such user here
    

提交回复
热议问题