Skip to content

Simple PHP snippet to validate emails server side

License

Notifications You must be signed in to change notification settings

farisc0de/email_validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

PHP Email Validation

Simple PHP code to validate emails server side

I wrote this code 2 years ago

It's a simple way to protect your contact form from spam emails

  1. Validate Email Format ([email protected])
  2. Ping Email Domain to make sure it's online
  3. Validate Email Provider from the list
    • Gmail.com
    • Hotmail.com
    • Outlook.com
    • msn.com
    • Outlook.sa
    • aol.com
    • protonmail.com

How to use

if(isValid("[email protected]")){

  echo "This is a valid email";
  
} else {

  echo "Please enter a valid email";
  
}

Copyright

FarisCode

About

Simple PHP snippet to validate emails server side

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages