瀏覽代碼

fixed send notify

Piotr Labudda 10 年之前
父節點
當前提交
a42f15db59
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      SE/se-lib/Route/Notify.php

+ 6 - 2
SE/se-lib/Route/Notify.php

@@ -204,7 +204,7 @@ function refreshPreview() {
 			if (!empty($listWhat)) {
 			if (!empty($listWhat)) {
 				$reminders = array_keys($listWhat);
 				$reminders = array_keys($listWhat);
 				echo "<p>Sending to {$who} reminders [" . implode(",", $reminders) . "] at '{$when}'</p>" . "\n";
 				echo "<p>Sending to {$who} reminders [" . implode(",", $reminders) . "] at '{$when}'</p>" . "\n";
-				$this->send($who, $listWhat, $when, $forceMail = 'plabudda@biall-net.pl');
+				$this->send($who, $listWhat, $when, $forceMail);
 				$this->markAsSent($who, $listWhat, $when);
 				$this->markAsSent($who, $listWhat, $when);
 			}
 			}
 		}
 		}
@@ -254,7 +254,11 @@ function refreshPreview() {
 		}
 		}
 		$message = ob_get_clean();
 		$message = ob_get_clean();
 
 
-		if (!mail($to, $subject, $message, $headers)) throw new Exception("Nie udało się wysłać powiadomienia");
+		trigger_error("send msg to {$to} ({$usrLogin}) when='{$when}'", E_USER_NOTICE);
+		if (!mail($to, $subject, $message, $headers)) {
+			trigger_error("Cannot send msg to {$to} ({$usrLogin}) when='{$when}'", E_USER_WARNING);
+			throw new Exception("Nie udało się wysłać powiadomienia");
+		}
 	}
 	}
 
 
 	public function getUserMainMail($usrLogin) {
 	public function getUserMainMail($usrLogin) {