Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isset($_POST['openemailmem'])){
- $memberuser = $_POST['openemailmemusername'];
- $sql = "SELECT email, username, password, status FROM csvdata WHERE memberview =:user ";
- $getinfo=$DBH->prepare($sql);
- $getinfo->execute(array(':user' => $memberuser));
- while ($row = $getinfo->fetch(PDO::FETCH_ASSOC)) {
- $check = $row;
- $newEmployeeEmail = $check['email'];
- $csvusername = $check['username'];
- $password = $check['password'];
- $status = $check['status'];
- if ($status == "Open"){
- echo "tesing";
- $from = "the email of where it is coming from is here but i removed";
- $to = $newEmployeeEmail;
- if (!empty($_POST['cc'])){
- $cc = $_POST['cc'];
- }
- if (!empty($_POST['ccsend'])){
- $cc = $_POST['ccsend'];
- $to .= ", $cc";
- }
- $subject = "removed msg";
- $body = "removed msg";
- $host = "i removed";
- $username = "i removed";
- $password = "i removed";
- $headers = array ('From' => $from, 'To' => $to,'Cc' => $cc, 'Subject' => $subject);
- $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password));
- $mail = $smtp->send($to, $headers, $body);
- }
- }
- header("Location: I removed this.php?getmsg=12");
- exit;
- }
- if (isset($_POST['openemailmem']))
- {
- $memberuser = $_POST['openemailmemusername'];
- $sql = "SELECT email, username, password, status "
- . "FROM csvdata WHERE memberview =:user ";
- $getinfo = $DBH->prepare($sql);
- $getinfo->execute(array(':user' => $memberuser));
- $log_file = "/home/my/transaction.log";
- $now = "[" . date("Ymd-His") . "] ";
- $message = $now . "Starting loop...";
- error_log($message, 3, $log_file);
- while ($row = $getinfo->fetch(PDO::FETCH_ASSOC))
- {
- $check = $row;
- $newEmployeeEmail = $check['email'];
- $csvusername = $check['username'];
- $password = $check['password'];
- $status = $check['status'];
- if ($status == "Open")
- {
- echo "tesing";
- $from = "the email of where it is coming from is here but i removed";
- $to = $newEmployeeEmail;
- if (!empty($_POST['cc']))
- {
- $cc = $_POST['cc'];
- }
- if (!empty($_POST['ccsend']))
- {
- $cc = $_POST['ccsend'];
- $to .= ", $cc";
- }
- $subject = "removed msg";
- $body = "removed msg";
- $host = "i removed";
- $username = "i removed";
- $password = "i removed";
- $headers = array(
- 'From' => $from,
- 'To' => $to,
- 'Cc' => $cc,
- 'Subject' => $subject,
- );
- $now = "[" . date("Ymd-His") . "] ";
- $message = $now . "Before connecting to server - " . $to;
- error_log($message, 3, $log_file);
- $smtp = Mail::factory(
- 'smtp',
- array(
- 'host' => $host,
- 'auth' => true,
- 'username' => $username,
- 'password' => $password,
- )
- );
- $now = "[" . date("Ymd-His") . "] ";
- $message = $now . "After connecting to server - " . $to;
- error_log($message, 3, $log_file);
- $now = "[" . date("Ymd-His") . "] ";
- $message = $now . "Before sending email - " . $to;
- error_log($message, 3, $log_file);
- $mail = $smtp->send($to, $headers, $body);
- $now = "[" . date("Ymd-His") . "] ";
- $message = $now . "After sending email - " . $to;
- error_log($message, 3, $log_file);
- }
- }
- $now = "[" . date("Ymd-His") . "] ";
- $message = $now . "End of loop";
- error_log($message, 3, $log_file);
- header("Location: I removed this.php?getmsg=12");
- exit;
- }
Add Comment
Please, Sign In to add comment