Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

send_mail()

Description

Send a mail - but correctly encode the message/subject in quoted-printable UTF-8.

NOTE: $from is the name of the user sending the email,
while $from_name is the name that should be put in the header, which can be the system name
It is necessary to specify two since in all cases the email should be able to contain the user's name.

Old mail function remains the same to avoid possible issues with phpmailer
send_mail_phpmailer allows for the use of text and html (multipart) emails,
and the use of email templates in Manage Content.

Parameters

ColumnTypeDefaultDescription
$email string Email address to send to
$subject string Email subject
$message string Message text
$from string "" From address - defaults to $email_from or user's email if $always_email_from_user enabled
$reply_to string "" Reply to address - defaults to $email_from or user's email if $always_email_from_user enabled
$html_template string "" Optional template (this is a $lang entry with placeholders)
$templatevars string null Used to populate email template placeholders
$from_name string "" Email from name
$cc string "" Optional CC addresses
$bcc string "" Optional BCC addresses
$files array array Optional array of file paths to attach in the format [filename.txt => /path/to/file.txt]

Return

void

This article was last updated 30th November 2020 17:35 Europe/London time based on the source file dated 30th November 2020 09:45 Europe/London time.