Documentation

SendPassword

array
CUser::SendPassword(
 string login,
 string email,
 string site_id = SITE_ID
)
USER_INFO. login or

The method sends a message with the control string used for password change. The message is sent using the template USER_PASS_REQUEST. The user can be identified either by login or e-mail address - via email parameter. The method returns an array containing the execution report message which can be passed to ShowMessage method). Non-static method.

Parameters

ParaemterDescription Available from version
login User login.
email User e-mail address.
site_id Site ID for USER_PASS_REQUEST mail template.
Optinoal parameter. By default - current site.
captcha_word Word for CAPTCHA.
Optional parameter. Passed if the "Use CAPTCHA when restoring password" option is enabled in the main module settings.
captcha_sid ID CAPTCHA.
Optional parameter. Passed if the "Use CAPTCHA when restoring password" option is enabled in the main module settings.

See Also

Examples of use

<?
global $USER;
$arResult = $USER->SendPassword($USER->GetLogin(), $USER->GetParam("EMAIL"));
if($arResult["TYPE"] == "OK") echo "Control string for the password change has been sent.";
else echo "The login (or e-mail) cannot be found.";
?>


© «Bitrix24», 2001-2024
Up