A simple PHP class to test
<?php
    
class EmailAddress {
        var 
$localPart;
        var 
$domain;
        var 
$address;
        function 
EmailAddress($address null) {
          if(
$address) {
            
$this->address $address;
            
$this->extract();
          }
        }
  
        function 
extract() {
          list(
$this->localPart$this->domain) =
          
explode("@"$this->address);
        }
    }
?>