[swx] simple mail w/ swx

Stefan Dosch sd at liquidlounge.de
Wed Dec 19 17:56:04 PST 2007


Email Validation:

returns true if email adress is valid or false if email adress is  
invalid.
This not only checks for correct syntax, but also tests if the domain  
is registered, so somepeep at jasdklaklsdfsdfsd.com would return false  
although syntax is correct, but the domain would not respond to  
getmxrr().

	function validate_email($email)
	{
	   $regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-] 
+)*(\.[a-z]{2,4})$";
	   $valid = false;
	   if (eregi($regexp, $email))
	   {
		  list($username,$domaintld) = split("@",$email);
		  if (getmxrr($domaintld,$mxrecords))
			 $valid = true;
	   } else {
		  $valid = false;
	   }	
	   return $valid;	
	}

htht
Stefan


--
Liquidlounge
Stefan Dosch
Perlschneiderstrasse 34
81241 München

tel: +49 89 55274994
fax: +49 89 55274993
mobil: +49 160 90554762
mailto: sd at liquidlounge.de
http://www.liquidlounge.de



Am 19.12.2007 um 20:57 schrieb Corban Baxter:

> Hey guys has anyone created a simple send email service for SWX? I'm  
> no PHP programmer and I was wanting to use SWX for my email forms.  
> Just sending like first name, last name, email, phone, comments,  
> etc. I really want to use it to like return errors of bad emails or  
> something. Does anyone have a service like this they might share  
> with me?!?! Please! ;)
>
> -- 
> -cb _______________________________________________
> swx mailing list
> swx at osflash.org
> http://osflash.org/mailman/listinfo/swx_osflash.org




More information about the swx mailing list