sendEmail() public method

Send an email.
public sendEmail ( $to, $subject, $message )
Ejemplo n.º 1
0
    $validLogin = $account->loginExists($_POST['login']);
    $emailSent = FALSE;
    if ($validLogin) {
        // Set a new token for the user.
        $token = $account->setToken($_POST['login']);
        // Create and send the email.
        $subject = $common->getSetting("siteName") . " Password Reset Request";
        $message = "A password reset request has been received by your ADS-B portal.\r\n";
        $message .= "\r\n";
        $message .= "If you did not request this password reset simply disregard this email.\r\n";
        $message .= "If in fact you did request a password reset follow the link below to do so.\r\n";
        $message .= "\r\n";
        $message .= "http://" . $_SERVER['HTTP_HOST'] . "/admin/reset.php?token=" . $token . "\r\n";
        $message .= "\r\n";
        $message .= "Your password reset token is: " . $token;
        $emailSent = $common->sendEmail($account->getEmail($_POST['login']), $subject, $message);
    }
}
/////////////////////
// BEGIN HTML BODY //
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title></title>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" />
        <link rel="stylesheet" href="assets/css/forgot.css" />
    </head>
    <body>