Documentation

Mail

bool
CFormResult::Mail(
 int result_id,
 mixed template_id = false
)

The function creates a mail event to send data of the result via e-mail. Return true on success, otherwise returns false. Non-static method.

Method parameters

Parameter Description
result_id ID of the result.
template_id ID of mail template.

Optional parameter. False by default (mail templates from the existing web from will be used).

Examples of use

<?
$RESULT_ID = 189; // result ID

// create a mail event to send the result data via e-mail 
if (CFormResult::Mail($RESULT_ID))
{
    echo "Mail event created successfully.";
}
else // error
{
    global $strError;
    echo $strError;
}
?>


© «Bitrix24», 2001-2024