sendmail

Description

Sends an email to the specified recipient(s).

Syntax

void sendmail (mixed $to, string $subject, string $message, string $from[, string $message_id[, bool $send_html[, int $priority[, bool $hotmail_fix]]]])



Parameter $to

Expected type: Mixed
Description: The email address(es) to send the message to.

Allowed types for $to
Allowed values Description
String A single email address
Array One or more email addresses



Parameter $subject

Expected type: Escaped String
Description: The subject of the email



Parameter $message

Expected type: Escaped String
Description: The message



Parameter $from

Expected type: String
Description: The "from" address for the email (if not specified or null, the webmaster email address is used)



Parameter $message_id

Expected type: String
Description: A string to be used for the "Message-ID" header



Parameter $send_html

Expected type: Boolean
Description: Whether or not to send the message in HTML format. Default is false.



Parameter $priority

Expected type: Integer
Description: The message priority. Mainly used with the mail queue - higher priority messages are sent first. If this is 4 or higher, the message is sent immediately. Defaults to 1.



Parameter $hotmail_fix

Expected type: Boolean
Description: Determines whether or not Hotmail-specific fixes should be applied. Also sends the email in HTML format to all addresses if true. If not specified, SMF will determine what to do (filters out hotmail addresses then calls this function recursively specifically for those addresses)


Notes

  • Uses the mail_type setting and the webmaster_email global.
  • To is the email address(es), string or array, to send the message to.
  • Subject and message are those of the email - expected to have slashes but not be parsed.
  • Subject is expected to have entities, message is not.
  • From is a string which masks the address for use with replies.
  • If message_id is specified, uses that as the local-part of the Message-ID header.
  • Send_html indicates whether or not the message is HTML vs. plain text, and does not add any HTML.
  • Priority determines how important the message is (mainly used for the mail queue)
  • Returns whether or not the email was sent properly.
Advertisement: