@param null $email

@return EmailAddress
558687
public function email($email = null)
  {
    $eml = EmailAddress::newInstance($this);
    if($email !== null)
    {
      $eml->setEmailAddress($email);
    }
    return $eml;
  }
1305067
public function setEmail($email, $defaultEmail = null)
    {
        if (!empty($email)) {
            $this->email = $email;
        } else if (!empty($defaultEmail)) {
            $this->email = $defaultEmail;
            if (substr($this->email, 0, 1) == '@') {
                $this->email = $this->getId() . $this->email;
            }
        } else {
            $this->email = '';
        }
    }
267413
public function setEmail($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->email !== $v) {
            $this->email = $v;
            $this->modifiedColumns[] = UserPeer::EMAIL;
        }


        return $this;
    }
1292525
public function email($sEmail = null)
    {
        if (null === $sEmail) {
            return $this->getEmail();
        }

        return $this->setEmail($sEmail);
    }
243062
public function getByEmail($email)
    {
        if (!is_string($email) || empty($email)) {
            return null;
        }

        $parameters = array(
            'api_action' => 'contact_view_email',
            'email' => $email
        );

        $response = $this->request($parameters);



        if ($response === null || $response->getStatusCode() !== 200) {
            return null;
        }

        $json = $response->getBody()->getContents();

        return $this->serializer->deserialize(
            $this->removeResultInformation($json),
            \FondOfPHP\ActiveCampaign\DataTransferObject\Contact::class,
            'json'
        );
    }
1184989
public function subscriberInfo(string $email) : Collection
    {
        try {
            return $this->api->get('lists/'.$this->id().'/members/'.$this->support->hashEmail($email));
        } catch (\Exception $e) {
            # Email address isn't on this list
            if (str_contains($e->getMessage(), 'Resource Not Found')) {
                throw new EmailAddressNotSubscribed;
            }

            throw $e;
        }
    }
1049123
@Nullable
  public static EmailAddress getAsEmailAddress (@Nullable final InternetAddress aInternetAddress)
  {
    return aInternetAddress == null ? null : new EmailAddress (aInternetAddress.getAddress (),
                                                               aInternetAddress.getPersonal ());
  }
628537
public function hasMx($email)
    {
        if (! $this->isEmail($email)) {
            return null;
        }

        $hostname = $this->hostnameFromEmail($email);

        if ($hostname) {
            return checkdnsrr($hostname, 'MX');
        }

        return null;
    }
42842
private function userFromEmail($email)
    {
        $parts = explode('@', $email);

        if (count($parts) == 2) {
            return strtolower($parts[0]);
        }

        return null;
    }
461575
public function findUserByEmail($email)
    {
        $qb = $this->createQueryBuilder('user')
            ->where('user.email=:email');

        $query = $qb->getQuery();
        $query->setParameter('email', $email);

        return $query->getSingleResult();
    }
445179
static public function extractDomainFromEmail($email)
    {
        if (Validator::validEmail($email)) {
            $splitArr = explode('@', $email);
            $domain = array_pop($splitArr);

            return $domain;
        }

        return null;
    }
484482
static function fetchByEmail( $email )
    {
        $cond = array( 'email' => $email );
        $return = eZPersistentObject::fetchObject( self::definition(), null, $cond );
        return $return;
    }
498849
public function ccAddress($email, $name = null)
    {
        $this->getMailer()->addCC($email, (empty($name)) ? $email : $name);

        return $this;
    }
1237580
@Nullable
  public IUser getUserOfEmailAddress (@Nullable final String sEmailAddress)
  {
    if (StringHelper.hasNoText (sEmailAddress))
      return null;

    return findFirst (x -> sEmailAddress.equals (x.getEmailAddress ()));
  }
966962
protected function _prepareFromAddress($email)
    {
        $from = $email->getReturnPath();
        if (empty($from)) {
            $from = $email->getFrom();
        }

        return $from;
    }
826951
public function isAdmin(?string $email = null): bool
    {
        if ($email === null) {
            return false;
        }
        return in_array($email, $this->getConfig()['admin']);
    }
660517
private function setEmailAddress(?string $emailAddress): self
    {
        $this->updatePropertyValue(
            EmailAddressFieldInterface::PROP_EMAIL_ADDRESS,
            $emailAddress
        );

        return $this;
    }