Skip to content
Snippets Groups Projects
Commit bad70cb5 authored by CarstenKarbach's avatar CarstenKarbach
Browse files

Add target mail as config parameter

parent ace71d52
No related branches found
No related tags found
No related merge requests found
;
; Do not commit changes to this config file!
;
; GMail example
;Host = "smtp.gmail.com"
;SMTPSecure = "ssl"
;SMTPSecure = "tls"
;Port = "587"
;verify_peer = true; set to false, if remote certificate cannot be verified
;Username = "testexample@gmail.com"
......@@ -15,3 +19,5 @@ verify_peer = true
Username = "testtest@gmx.de"
Password = "XXX"
FROMNAME = "Jards"
TARGET="carstenkarbach@gmx.de"
\ No newline at end of file
......@@ -17,7 +17,7 @@ function sendmail($to, $subject, $message){
$mail->SMTPSecure = $config['SMTPSecure'];
$mail->Port = intval($config['Port']);
$mail->SMTPDebug = 0;
$mail->SMTPDebug = 4;
$mail->SMTPAuth = true;
if($config['verify_peer']==false){
......@@ -46,6 +46,7 @@ $body = 'This is the message '.$date;
$subject = 'hi';
sendmail('carstenkarbach@gmx.de', $subject, $body);
$config = parse_ini_file(__DIR__.'/../configs/mail.cnf');
sendmail($config['TARGET'], $subject, $body);
?>
\ No newline at end of file
......@@ -57,7 +57,8 @@ class MailOnEventListener implements EventListener{
* @param unknown $event
*/
public function handleEvent($event){
$this->sendmail('carstenkarbach@gmx.de', 'New event received', json_encode($event));
$config = parse_ini_file(__DIR__.'/../configs/mail.cnf');
$this->sendmail($config['TARGET'], 'New event received', json_encode($event));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment