email scrub - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: email scrub (/showthread.php?tid=7585) |
email scrub - El Forum - 04-15-2008 [eluser]infusionmedia[/eluser] I am currently working on a list management application. I need to be able to segregate email data based on tld, non-tld, .gov, .edu, @spam... I guess my question is, has anybody else worked on something similar that can share some info and/or share some code that I can implement into this application? Thanks... email scrub - El Forum - 04-15-2008 [eluser]Leggy[/eluser] You could do a regex to see if it a valid email e.g. (taken from the CI validator class) Code: preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str) There are better ways, i used to have a very good one but i have lost it since. EDIT: I think i found it again, i made a few alterations to the code but here is the function: Code: function check_email( $email, $rec_type = 'MX' ) email scrub - El Forum - 04-15-2008 [eluser]infusionmedia[/eluser] i appreciate the response. thanks. email scrub - El Forum - 04-15-2008 [eluser]infusionmedia[/eluser] dude. you are the man, that was very helpful. |