Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('../lib/functions.php');
- if (!isset($_POST['hostname'])) die();
- $hostname = $_POST['hostname'];
- $results = $_POST['results'];
- $ip = $_POST['ip'];
- $email = $_POST['email'];
- awsMail('[email protected]', $email, 'log4j2 report', "found one!\n hostname: $hostname \n ip: $ip \n\n $results");
- function awsMail($from, $to, $subject, $txtBody, $htmlBody = false) {
- global $awsClient;
- $SesClient = $awsClient->createSes();
- if (!is_array($to)){
- $to = [$to];
- }
- $toSend = [
- 'Source' => $from,
- 'Destination' => ['ToAddresses' => $to],
- 'Message' => [
- 'Subject' => ['Data' => $subject],
- 'Body' => [
- 'Text' => ['Data' => $txtBody]
- ]
- ]
- ];
- if ($htmlBody) $toSend['Message']['Body']['Html'] = ['Data' => $htmlBody];
- $SesClient->sendEmail($toSend);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement