Smtp Object : Verify Method |
Visual Basic |
---|
Public Function Verify( _ ByVal DnsServers As DartStrings, _ ByVal Address As String _ ) As VerifyMethodConstants |
This blocking method will verify if the domain of the specified address is valid, and that the user is a valid user within the domain.
The From address will be used as the MAIL FROM parameter when communicating with the SMTP server. If this property is not set, the control will use the address to be verified as the From address.
If the email address is badly formed, the specified domain does not exist, the mail server does not respond, or the user does not exist, a VerifyMethodConstant will be returned designating the nature of the problem. If the address is valid, the VerifyMethodConstant returned will be verifyValid.
If there is no response from the first DNS server in the DnsServers collection after three attempts, the next server will be tried. This will continue until the list of servers is exhausted. If a connection has already been established using the Login method, the Verify method will return with error ptConnect, as this method makes its own connection. Also, if the current thread is blocking, a ptBlocked error will result.
Please note that the performance of this capability is dependent upon the responsiveness of the DNS Servers used and security of the SMTP server. Some servers accept invalid mail and return later. This will cause an address to be falsely evaluated as good. In addition, failure may occur if your machine does not allow incoming traffic on port 113, which is used by mail servers to check port identity of the requesting machine.