sendmail

Description

Sends an email to the specified recipient(s).

Syntax

bool sendmail (mixed $to, string $subject, string $message[, string $from[, bool $send_html]])



Parameter $to

Expected type: Mixed
Description: The email address(es) the message should be sent to

Allowed types for $to
Allowed values Description
String A single email address
Array An array containing 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 actual email message



Parameter $from

Expected type: String
Description: The address to be used as the "from" address. If not specified, the webmaster email address is used.



Parameter $send_html

Expected type: Boolean
Description: Whether or not to send the email in HTML format (note: this option will send both HTML and plain text in the same message and let the email client decide what to do). Default is false.



Return value

Expected type: Boolean
Description: Whether or not the email was sent successfully


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.
  • 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: