Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2017
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. <?php
  2. require_once("/etc/inc/sasl.inc");
  3. require_once("/etc/inc/smtp.inc");
  4.  
  5. $from = 'matrix@gmail.com';
  6. $to = 'matrix@gmail.com';
  7. $user = 'matrix@gmail.com';
  8. $pass = 'matrixPass';
  9. $smtp->host_name = "smtp.gmail.com";
  10. $smtp->host_port = "465";
  11.  
  12.  
  13. //Set the variables for the post results
  14. $name=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['name']));
  15. $manager=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['manager']));
  16. $website=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['website']));
  17. $clientip=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['clientip']));
  18. $reason=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['reason']));
  19. //Create the email notice
  20. $message = "
  21. <br><b><font style=color:#CC3300>$sub</font></b><br>
  22. <table width=708 border=0 cellpadding=2 cellspacing=1 bgcolor=#CCCCCC>
  23.  
  24. <tr>
  25. <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Name:</b> </td>
  26. <td width=565 align=left valign=top bgcolor=#FFFFFF>{$name}</td>
  27. </tr>
  28.  
  29. <tr>
  30. <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Manager:</b> </td>
  31. <td width=565 align=left valign=top bgcolor=#FFFFFF>{$manager}</td>
  32. </tr>
  33.  
  34. <tr>
  35. <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Website:</b> </td>
  36. <td width=565 align=left valign=top bgcolor=#FFFFFF>{$website}</td>
  37. </tr>
  38.  
  39. <tr>
  40. <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Client IP:</b> </td>
  41. <td width=565 align=left valign=top bgcolor=#FFFFFF>{$clientip}</td>
  42. </tr>
  43.  
  44. <tr>
  45. <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Reason:</b> </td>
  46. <td width=565 align=left valign=top bgcolor=#FFFFFF>{$reason}</td>
  47. </tr>
  48.  
  49. </table>
  50. ";
  51.  
  52. $smtp = new smtp_class;
  53.  
  54.  
  55. $smtp->direct_delivery = 0;
  56. $smtp->ssl = 1;
  57. $smtp->debug = 0;
  58. $smtp->html_debug = 0;
  59. $smtp->localhost="pfsense.local";
  60.  
  61. $smtp->authentication_mechanism = "PLAIN";
  62. $smtp->user = $user;
  63. $smtp->password = $pass;
  64.  
  65. $x = "From: {$from}";
  66. $x = "To: {$to}";
  67. $x = "Subject: pfsense.local - Notification";
  68. $x = "Date: ".strftime("%a, %d %b %Y %H:%M:%S %Z");
  69.  
  70.  
  71.  
  72. if($smtp->SendMessage($from, array($to), $xheaders, $message)) {
  73. print("Message sent to {$to} OK");
  74. return;
  75. } else {
  76. print("Could not send the message to {$to} -- Error: {$smtp->error}");
  77. }
  78.  
  79. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement