Code for validating email id in php

Rated 4.37/5 based on 672 customer reviews

Email marketing is still one of the most efficient ways to reach your customer, leads and site followers.If your mailing list becomes older and hasn’t been used for some time, there is serious chance that some of the email addresses aren’t valid anymore.First import your email addresses into a My SQL database.Create a simple table structure (ID, email, status) and import all email address using the import feature from php My Admin.Even if you use a SMTP validation script, there is a chance the sending IP address becomes on a black list. Last time I need to check a list where I know that 25% of the email addresses has bounced while a customer has send his email campaigns.I use my laptop to check them using the SMTP connection from my own ISP which I never use for email :)Checking 6000 email addresses will take some time, so it’s better to check smaller packages by running a CRON job.

You can put your validations in a separate file for better re-use code and organization: It is important that validators return a valid boolean value indicating if the validation was successful or not.

If the domain name doesn’t exists or is not configured, the MX record is missing, too.

Establish a SMTP connection and check on the target server if the email address still exists and accepts emails.

This service is very good and doesn’t show many false results and I use them from time to time to check a single address where the email was bounced.

The offer also premium plans and an API system to check multiple email addresses.

Leave a Reply