6 ms·
How to check if an email address exists without sending an email?
- brk 18y agoNeat tip. Keep in mind that with all the modern email server "cloaking" and anti-spam measures this is not an absolute test. If the server rejects it, you can be fairly sure the address is invalid. If it accepts it, you cannot 100% sure that an email actually sent to that address would get delivered all the way through to a physical mbox.
- patio11 18y agoThe number of false positives you will get with this trick is truly disgustingly high. Blame the spammers who were using this upwards of ten years ago (!) to validate their spam lists.
- themanual 18y agoGreat! This works for gmail also.
- biohacker42 18y agoI believe there is a protocol to ask a mail server an address is real, it's slow but works without sending an email. Obviously anti spam measure make all of this void.
- jcapote 18y ago(?:[a-z0-9!#$%&'+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'+/=?^_`{|}~-]+)|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])")@(?:(?:[a-z0-9](?:[a-z0-9-][a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-][a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
- furyg3 18y agoThis is a path that starts with you calling telnet from php, and ends with you reinventing sendmail. Trust me: just send the damn mail. The world of SMTP is a dynamic, volatile place and you should let your transport agent take care of these things. Otherwise you're going to be bumping up against MX relays (which will answer "yes" to any user at that domain), spam filters that will take any email, sender verification failures, SPF, and a whole lot of other things that will distract you from running your site.