Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("/etc/inc/sasl.inc");
- require_once("/etc/inc/smtp.inc");
- $from = 'matrix@gmail.com';
- $to = 'matrix@gmail.com';
- $user = 'matrix@gmail.com';
- $pass = 'matrixPass';
- $smtp->host_name = "smtp.gmail.com";
- $smtp->host_port = "465";
- //Set the variables for the post results
- $name=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['name']));
- $manager=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['manager']));
- $website=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['website']));
- $clientip=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['clientip']));
- $reason=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['reason']));
- //Create the email notice
- $message = "
- <br><b><font style=color:#CC3300>$sub</font></b><br>
- <table width=708 border=0 cellpadding=2 cellspacing=1 bgcolor=#CCCCCC>
- <tr>
- <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Name:</b> </td>
- <td width=565 align=left valign=top bgcolor=#FFFFFF>{$name}</td>
- </tr>
- <tr>
- <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Manager:</b> </td>
- <td width=565 align=left valign=top bgcolor=#FFFFFF>{$manager}</td>
- </tr>
- <tr>
- <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Website:</b> </td>
- <td width=565 align=left valign=top bgcolor=#FFFFFF>{$website}</td>
- </tr>
- <tr>
- <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Client IP:</b> </td>
- <td width=565 align=left valign=top bgcolor=#FFFFFF>{$clientip}</td>
- </tr>
- <tr>
- <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Reason:</b> </td>
- <td width=565 align=left valign=top bgcolor=#FFFFFF>{$reason}</td>
- </tr>
- </table>
- ";
- $smtp = new smtp_class;
- $smtp->direct_delivery = 0;
- $smtp->ssl = 1;
- $smtp->debug = 0;
- $smtp->html_debug = 0;
- $smtp->localhost="pfsense.local";
- $smtp->authentication_mechanism = "PLAIN";
- $smtp->user = $user;
- $smtp->password = $pass;
- $x = "From: {$from}";
- $x = "To: {$to}";
- $x = "Subject: pfsense.local - Notification";
- $x = "Date: ".strftime("%a, %d %b %Y %H:%M:%S %Z");
- if($smtp->SendMessage($from, array($to), $xheaders, $message)) {
- print("Message sent to {$to} OK");
- return;
- } else {
- print("Could not send the message to {$to} -- Error: {$smtp->error}");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement