/** * Check if an email address is valid. * * The best regex we have for validating email addresses is in PHPMailer and we really shouldn't accept email * addresses that can't pass the PHPMailer test since we wouldn't be able to send to them. * * @see PHPMailerProxy::ValidateAddress() * @param string $emailAddress * @return bool */ public static function isValidEmail($emailAddress) { require_once 'modules/Mailer/PHPMailerProxy.php'; return PHPMailerProxy::ValidateAddress($emailAddress); }
/** * Overloads PHPMailer::SmtpConnect() to log the correct error message based on the email configuration used for * connecting to the SMTP server. * * @param array $options * @return bool */ public function SmtpConnect($options = array()) { $connection = parent::SmtpConnect($options); if (!$connection) { global $app_strings; if (isset($this->oe) && $this->oe->type == "system") { $this->SetError($app_strings['LBL_EMAIL_INVALID_SYSTEM_OUTBOUND']); } else { $this->SetError($app_strings['LBL_EMAIL_INVALID_PERSONAL_OUTBOUND']); } // else } return $connection; }