You can perform a DNS query of the domain name (the part of the e-mail-address after the @
symbol) to determine whether the domain is valid and has an MX record. To verify the username (the part of the e-mail-address before the @
symbol), you will have to query the destination mail server itself, for example using the VRFY
SMTP command. However, for security reasons, some mail servers may not support this command.
The C language itself does not provide any functions with which you can send network packets. However, most platforms provide an API which offers this functionality (e.g. POSIX sockets, Windows sockets). Some platforms also provide an API which performs the DNS query for you. Also, several libraries exist which provide this functionality.