Giter Site home page Giter Site logo

luger95 / verifyemail Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hbattat/verifyemail

1.0 2.0 0.0 184 KB

PHP function to verify if the email is valid by connecting to the mail server and checking the result.

License: Apache License 2.0

PHP 100.00%

verifyemail's Introduction

emailVerify

Is a PHP function that can be easily used to verify an email address and make sure it is valid and does exist on the mail server.

This function connects to the mail server and checks whether the mailbox exists or not.

How to use:

Simply call the function:

The first email address '[email protected]' is the one to be checked, and the second '[email protected]' is an email address to be provided to the server (just for testing, but would be better if it is a valid email)

This will restun a string "valid" if the email [email protected] is valid, and "invalid" if the email is invalid

If you want to get the the actual details of that connection, add another parameter to the function:

print_r(verifyEmail('[email protected]', '[email protected]', true));

This will resturn an array that looks like this:

Array ( [0] => invalid [1] => 250 mx.google.com at your service 250 2.1.0 OK u4si6155213qat.124 - gsmtp 550-5.1.1 The email account that you tried to reach does not exist. Please try )

Notes:

  • Some mail servers will silentlty reject the test message, to prevent spammers from checking against their users' emails and filter the valid emails, so this function might not work properly with all mail servers.

verifyemail's People

Contributors

hbattat avatar spartas avatar

Stargazers

Alexandre Normand avatar

Watchers

James Cloos avatar Alexandre Normand avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.