121 |
- |
1 |
<?php
|
|
|
2 |
$data = json_decode($HTTP_RAW_POST_DATA,true);
|
|
|
3 |
$to = 'email@uwejacobs.com';
|
|
|
4 |
$from = 'noreplyl@findcheapmusic.com';
|
|
|
5 |
$subject = 'CSP Violations';
|
|
|
6 |
$message="Following violations occured:<br/><br/>";
|
|
|
7 |
if($document_uri!="")
|
|
|
8 |
$message.="<b>Document URI:</b> ".$data['csp-report']['document-uri']."<br/><br/>";
|
|
|
9 |
if($referrer!="")
|
|
|
10 |
$message.="<b>Referrer:</b> ".$data['csp-report']['referrer']."<br/><br/>";
|
|
|
11 |
if($blocked_uri!="")
|
|
|
12 |
$message.="<b>Blocked URI:</b> ".$data['csp-report']['blocked_uri']."<br/><br/>";
|
|
|
13 |
if($violated_directive!="")
|
|
|
14 |
$message.="<b>Violated Directive:</b> ".$data['csp-report']['violated_directive']."<br/><br/>";
|
|
|
15 |
if($original_policy!="")
|
|
|
16 |
$message.="<b>Original Policy:</b> ".$data['csp-report']['original_policy']."<br/><br/>";
|
|
|
17 |
|
|
|
18 |
// To send HTML mail, the Content-type header must be set
|
|
|
19 |
$headers .= 'From: Example Website <noreply@example.com>' . "\r\n";
|
|
|
20 |
|
|
|
21 |
// Mail it
|
|
|
22 |
mail($to, $subject, $message, "From: $from");
|