You are here

function _smtp_recipients_to_address_list in SMTP Authentication Support 5

1 call to _smtp_recipients_to_address_list()
_drupal_mail_wrapper in ./smtp.module
Sends out the email.

File

./smtp.module, line 385
Enables drupal to send email directly to an SMTP server using authentication. Uses the PHPMailer class by Brent R. Matzelle.

Code

function _smtp_recipients_to_address_list($recipients) {
  $address_list = array();
  $addresses = split(",", $recipients);
  foreach ($addresses as $address) {
    if (strpos($address, '<') !== false) {
      $parts = explode(" <", $address);
      $name = $parts[0];
      $addr = rtrim($parts[1], ">");
    }
    else {
      $name = "";
      $addr = $address;
    }
    $address_list[] = array(
      'addr' => $addr,
      'name' => $name,
    );
  }
  return $address_list;
}