function sendMailWithQuestionnaire($email, $qId) { $subject = "Survey invitation"; $message = "Here is the linkt to a survey about our products.\n <br> We would like you to take part in it."; $pollLink = curPageURLMain(); $qidmd5 = md5($qId . "BOMBA"); $pollLink .= "/Ankietour/takeSurvey.php?questionnaireId={$qidmd5}"; $message .= "<br/><br/><br/> Unsubscribe: {$pollLink}"; sendMailPhpMailer($email, $subject, $message); }
function sendMail($to, $subject, $message, $header = "", $parameters = "", $skipblacklistcheck = 0) { if (TEST) { return 1; } # do a quick check on mail injection attempt, @@@ needs more work if (preg_match("/\n/", $to)) { logEvent("Error: invalid recipient, containing newlines, email blocked"); return 0; } if (preg_match("/\n/", $subject)) { logEvent("Error: invalid subject, containing newlines, email blocked"); return 0; } if (!$to) { logEvent("Error: empty To: in message with subject {$subject} to send"); return 0; } elseif (!$subject) { logEvent("Error: empty Subject: in message to send to {$to}"); return 0; } if (!$skipblacklistcheck && isBlackListed($to)) { logEvent("Error, {$to} is blacklisted, not sending"); Sql_Query(sprintf('update %s set blacklisted = 1 where email = "%s"', $GLOBALS["tables"]["user"], $to)); addUserHistory($to, "Marked Blacklisted", "Found user in blacklist while trying to send an email, marked black listed"); return 0; } if ($GLOBALS['usephpmailer']) { return sendMailPhpMailer($to, $subject, $message); } else { return sendMailOriginal($to, $subject, $message, $header, $parameters); } return 0; }
$startDay = $row["startday"]; $startHour = $row["starthour"]; $endHour = $row["endhour"]; $sectionLength = $row["sectionlength"]; } $jsonStringWithAllPoints = selectAllPointsFromMeeting($selectedMeetingName); } } else { if (isset($_POST["sendNotifications"])) { if (isset($_POST["selectedMeetingName"])) { $selectedMeetingName = $_POST["selectedMeetingName"]; $emails = selectAllUsersEmailsRelatedToMeetingName($selectedMeetingName); $subject = "Date of the meeting: " . $selectedMeetingName; $message = "The meeting will start: " . $_POST["startMeeting"] . "\n"; $message .= "The meeting will end: " . $_POST["stopMeeting"] . "\n"; sendMailPhpMailer($emails, $subject, $message); if ($selectedMeetingName != "") { $ret = selectMeetingByName($selectedMeetingName); while ($row = $ret->fetchArray(SQLITE3_ASSOC)) { $startDay = $row["startday"]; $startHour = $row["starthour"]; $endHour = $row["endhour"]; $sectionLength = $row["sectionlength"]; } $jsonStringWithAllPoints = selectAllPointsFromMeeting($selectedMeetingName); } } } } } ?>