Author Topic: Better email address checking  (Read 2885 times)

0 Members and 1 Guest are viewing this topic.

schumacher

  • Guest
Better email address checking
« on: August 05, 2002, 01:54:16 AM »
If we could include this function :

http://de.php.net/manual/en/function.getmxrr.php

then we could decrease the number of bad email addresses by checking if the host of the email address is accepting mail.

"getmxrr --  Get MX records corresponding to a given Internet host name"

How to make it work with the current pattern matching code?

function check_email($email) {
  return (preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', $email)) ? 1 : 0;
}

Thank you!

Schumi  :arrow:

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Better email address checking
« Reply #1 on: August 05, 2002, 09:32:12 AM »
Check the User Contributed Notes, there is an example how to do this.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search