You are here

public function SmtpMailSystem::mail in SMTP Authentication Support 7

Same name and namespace in other branches
  1. 7.2 smtp.mail.inc \SmtpMailSystem::mail()

Send the e-mail message.

Parameters

$message: A message array, as described in hook_mail_alter().

Return value

TRUE if the mail was successfully accepted, otherwise FALSE.

Overrides MailSystemInterface::mail

See also

drupal_mail()

File

./smtp.mail.inc, line 48
The code processing mail in the smtp module.

Class

SmtpMailSystem
Modify the drupal mail system to use smtp when sending emails. Include the option to choose between plain text or HTML

Code

public function mail(array $message) {
  if (variable_get('smtp_queue', FALSE) && (!isset($message['params']['skip_queue']) || !$message['params']['skip_queue'])) {
    smtp_send_queue($message);
    if (variable_get('smtp_debugging', SMTP_LOGGING_ERRORS) == SMTP_LOGGING_ALL) {
      watchdog('smtp', 'Queue sending mail to: @to', array(
        '@to' => $message['to'],
      ));
    }
    return TRUE;
  }
  else {
    return $this
      ->mailWithoutQueue($message);
  }
}