Esempio n. 1
0
function attemptSendInviteEmail($emailAddressToSendInviteTo)
{
    $subject = "You have been invited to create an account for: The Linger Martini Bar";
    $headers = getEmailHeader($_SESSION['user']['email'], "html");
    $emailContent = getInviteEmailContent($emailAddressToSendInviteTo);
    $emailSentSuccessfully = mail($emailAddressToSendInviteTo, $subject, $emailContent, $headers);
    return $emailSentSuccessfully;
}
Esempio n. 2
0
function sendInternalUserMessage($id, $subject, $message, $footer = "", $attachments = array(), $action = "")
{
    $from = "*****@*****.**";
    $fromName = "Schokolat";
    $qry = "SELECT B.email, B.firstname, B.lastname FROM {$_SESSION['DB_PREFIX']}members B " . "WHERE B.member_id = " . getLoggedOnMemberID();
    $result = mysql_query($qry);
    //Check whether the query was successful or not
    if ($result) {
        while ($member = mysql_fetch_assoc($result)) {
            $from = $member['email'];
            $fromName = $member['firstname'] . " " . $member['lastname'];
        }
    }
    $qry = "SELECT B.email, B.firstname FROM {$_SESSION['DB_PREFIX']}members B " . "WHERE B.member_id = {$id} ";
    $result = mysql_query($qry);
    //Check whether the query was successful or not
    if ($result) {
        while ($member = mysql_fetch_assoc($result)) {
            smtpmailer($member['email'], $from, $fromName, $subject, getEmailHeader() . "<h4>Dear " . $member['firstname'] . ",</h4><p>" . $message . "</p>" . getEmailFooter() . $footer, $attachments);
            $subject = mysql_escape_string($subject);
            $message = mysql_escape_string($message);
            sendMessage($subject, $message, $id, $action);
        }
    } else {
        logError($qry . " - " . mysql_error());
    }
    if (!empty($error)) {
        echo $error;
    }
}