Is there a way to check if an email is EXISTED using php?

Recently, I have been receiving more and more spam emails. I'm already checking my email using regex, all emails should be something like this: xxx@xxxx.xxx

But I have a problem now, there are many spammers like hsdjsdhgf@gmail.com , iluvhahahahah@yahoo.com , these emails do not exist because I tried to send them email.

How to avoid these emails?

0


a source to share


3 answers


You are barking the wrong tree. The best way to stop spam is to filter it out of the form in other ways. Unless you are a fan of CAPTCHAs like reCAPTCHA , you should look at what is known as "Honeypots" . Essentially, add an extra field to your form with a generic name such as "email" and hide it with CSS. Mark it as "leave blank" for those viewing styles disabled. If a field has a value in it, it is most likely a bot, so throw the view. Voila. They work great for your average midsize website and spammers really don't want to be hit specifically. Check out this related question .

All things considered, I love honeypots because it's usually enough to deter 99% of your spam and not force your regular user to do anything. It is important.



To quickly answer the original question: The only way to authenticate an email is to actually send an email to that address and see if it bounces. However, this is generally not worth the hassle.

+5


a source


If they subscribe to a newsletter or something that you will email them more than once, I would like to send them a confirmation email that they have to click on a link to make sure it is a real email address. If they don't confirm after a few days, then you know you can delete it. If they confirm, then you know that this is a real person. You will still get bounces back when you email them first, but this will eliminate duplicate bounces.



I also like CAPTCHAs, or if you need something easier to ask them to enter the first letter of your site name (or another word that will always stay the same on the page), it works for smaller to medium sites but is mostly effective.

0


a source


The short answer is:

Use CAPTCHA.

Long answer:

Well, you can do an MX search where you find the server responsible for delivering email for your domain, and then query the mail server to see if the address is valid. In a perfect world, this would be the perfect way to validate email addresses.

Unfortunately, as a measure of protection against spam, most mail servers these days will respond to such a request with either all positives or negative ones.

This leaves us with only one practical solution: the CAPTCHA.

0


a source







All Articles