public function MailSystemInterface::mail

public MailSystemInterface::mail(array $message)

Send a message composed by drupal_mail().

Parameters

$message: Message array with at least the following elements:

  • id: A unique identifier of the e-mail type. Examples: 'contact_user_copy', 'user_password_reset'.
  • to: The mail address or addresses where the message will be sent to. The formatting of this string will be validated with the PHP e-mail validation filter. Some examples are:
  • subject: Subject of the e-mail to be sent. This must not contain any newline characters, or the mail may not be sent properly.
  • body: Message to be sent. Accepts both CRLF and LF line-endings. E-mail bodies must be wrapped. You can use drupal_wrap_mail() for smart plain text wrapping.
  • headers: Associative array containing all additional mail headers not defined by one of the other parameters. PHP's mail() looks for Cc and Bcc headers and sends the mail to addresses in these headers too.

Return value

TRUE if the mail was successfully accepted for delivery, otherwise FALSE.

File

includes/mail.inc, line 331
API functions for processing and sending e-mail.

Class

MailSystemInterface
An interface for pluggable mail back-ends.

Code

public function mail(array $message);

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!mail.inc/function/MailSystemInterface::mail/7.x