Exemplo n.º 1
0
function sendPWMail($username, $email, $newPW)
{
    $plaintextmsg = 'Your password has been reset to: "' . $newPW . '". You should reset this the next time you log in.';
    $htmlmsg = '<p>Your password has been reset to: "' . $newPW . '". You should reset this the next time you log in.</p>';
    // The message already mentions the password, but advertising it on the
    // subject line seems even more unsafe.
    $subj = 'Phoebe A. Hearst Museum';
    return sendDelphiMail($username, $email, $subj, $plaintextmsg, $htmlmsg);
}
Exemplo n.º 2
0
function sendRegMail($uid, $username, $email)
{
    global $CFG;
    $confirmUrl = $CFG->wwwroot . '/modules/auth/register.php?confirm=' . $uid;
    $plaintextmsg = 'Thank you for registering with Delphi!

Your username (to log in to the system) is: ' . $username . '

If you forget your password, you can ask the system 
to email it to you. You can also change it on your profile page.

Click on the link below ' . 'or copy and paste the URL into your browser to complete the registration.

		 ' . $confirmUrl;
    $htmlmsg = '<p>Thank you for registering with Delphi!</p><p>Your username is: ' . $username . '</p>' . '<p>If you forget your password, you can ask the system' . ' to email it to you. You can also change it on your profile page.</p>' . '<p>Click on the link below ' . 'or copy and paste the URL into your browser to complete the registration.' . '<br /><br /><a href="' . $confirmUrl . '">' . $confirmUrl . '</a></p>';
    $subj = 'Phoebe A. Hearst Museum: Delphi registration';
    return sendDelphiMail($username, $email, $subj, $plaintextmsg, $htmlmsg);
}
$_POST['Subj'] -- Subject string
$_POST['Msg'] -- User-provided message
*/
if (isset($_POST['set_id']) && isset($_POST['To']) && isset($_POST['Subj']) && isset($_POST['Msg'])) {
    $nameTo = "";
    $emailTo = $_POST['To'];
    $subj = $_POST['Subj'];
    if (!isset($subj) || empty($subj)) {
        $subj = $_SESSION['username'] . " shared a Delphi set with you";
    }
    $plaintextmsg = $_POST['Msg'] . "\n\nHere is a link to the set:\n" . $CFG->wwwroot . "/modules/sets/viewset.php?sid=" . $_POST['set_id'];
    $htmlmsg = "<p>" . $_POST['Msg'] . "</p>" . "<br /><h3><a href='" . $CFG->wwwroot . "/modules/sets/viewset.php?sid=" . $_POST['set_id'] . "'>Click here to see the set!</a></h3>";
    $emailFrom = $_SESSION['email'];
    $nameFrom = $_SESSION['username'];
    $response = array();
    if (sendDelphiMail($nameTo, $emailTo, $subj, $plaintextmsg, $htmlmsg, $emailFrom, $nameFrom)) {
        $response['success'] = true;
    } else {
        $response['success'] = false;
        $response['msg'] = "Failed to send!";
    }
    echo json_encode($response);
} else {
    // Run cheesy test
    ?>
  <html><body>
		<form method="post" accept-charset="utf-8" id="viewset_setShareForm">
			<table cellspacing="2px" cellpadding="2px">
        <tr>
					<td><p style="text-align:right">To:&nbsp;</p></td><td><input type="text" size="40" name="To" value=""/></td>
        </tr>