sendmail

Description

Sends an email to the specified recipient(s).

Syntax

bool 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
Array An array of one or more email addresses
String A single email address (will get converted to an array)



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 in 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: This parameter has been reserved for future use...



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)



Return value

Expected type: Boolean
Description: True if the message was sent successfully, false otherwise


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.
  • Returns whether or not the email was sent properly.
Advertisement: