You are here

function phpmailer_parse_address in PHPMailer 5

Same name and namespace in other branches
  1. 8.3 phpmailer.module \phpmailer_parse_address()
  2. 5.2 phpmailer.module \phpmailer_parse_address()
  3. 6.3 phpmailer.module \phpmailer_parse_address()
  4. 6 phpmailer.module \phpmailer_parse_address()
  5. 6.2 phpmailer.module \phpmailer_parse_address()
  6. 7.4 phpmailer.module \phpmailer_parse_address()
  7. 7.3 phpmailer.module \phpmailer_parse_address()
2 calls to phpmailer_parse_address()
mimemail_phpmailer_send in includes/mimemail.inc
Sends out the email.
phpmailer_send in includes/phpmailer.inc
Sends out the email.

File

./phpmailer.module, line 99
This module integrates PHPMailer with Drupal, both as native drupal_mail() wrapper, and as part of the Mime Mail module.

Code

function phpmailer_parse_address($address) {
  $regexp = "/^(.*) <([a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\\.-][a-z0-9]+)*)+\\.[a-z]{2,})>\$/i";
  if (preg_match($regexp, $address, $matches)) {
    return array(
      'name' => trim($matches[1], '"'),
      'address' => $matches[2],
    );
  }
  return FALSE;
}