Function __global->dispatch_mail

Definitions

sources/mail.php

  • Attempt to send an e-mail to the specified recipient. The mail will be forwarding to the CC address specified in the options (if there is one, and if not specified not to cc).The mail will be sent in dual HTML/text format, where the text is based on the unconverted Comcode source: if a member does not enjoy reading HTML mail, they may wish to fallback to reading that.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$subject_line string No No required parameter N/A N/A The subject of the mail in plain text
$message_raw LONG_TEXT No No required parameter N/A N/A The message, as Comcode
$message_web LONG_TEXT No No required parameter N/A N/A The alternate message to use in the web version, as Comcode (blank: same as $message_raw)
$to_emails ?array No No Null N/A N/A The destination (recipient) e-mail address(es) [array of strings] (null: site staff address)
$to_names ?mixed No No Null N/A N/A The recipient name(s). Array or string. (null: site name)
$from_email EMAIL No No Blank (empty string) N/A N/A The reply-to address (blank: site staff address)
$from_name string No No Blank (empty string) N/A N/A The from name (blank: site name)
$advanced_parameters array No No [] N/A N/A A map of additional parameters. See comments within this function implementation to know what can be sent.

Returns

  • Our dispatcher object, which may contain some result data
  • Type: object
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Attempt to send an e-mail to the specified recipient. The mail will be forwarding to the CC address specified in the options (if there is one, and if not specified not to cc).The mail will be sent in dual HTML/text format, where the text is based on the unconverted Comcode source: if a member does not enjoy reading HTML mail, they may wish to fallback to reading that.
 *
 * @param  string $subject_line The subject of the mail in plain text
 * @param  LONG_TEXT $message_raw The message, as Comcode
 * @param  LONG_TEXT $message_web The alternate message to use in the web version, as Comcode (blank: same as $message_raw)
 * @param  ?array $to_emails The destination (recipient) e-mail address(es) [array of strings] (null: site staff address)
 * @param  ?mixed $to_names The recipient name(s). Array or string. (null: site name)
 * @param  EMAIL $from_email The reply-to address (blank: site staff address)
 * @param  string $from_name The from name (blank: site name)
 * @param  array $advanced_parameters A map of additional parameters. See comments within this function implementation to know what can be sent.
 * @return object Our dispatcher object, which may contain some result data
 */

function dispatch_mail(string $subject_line, string $message_raw, string $message_web, ?array $to_emails = null, $to_names = null, string $from_email = '', string $from_name = '', array $advanced_parameters = []) : object