Advertisement
pbowers

email_test.php

Aug 29th, 2016
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.52 KB | None | 0 0
  1. <?php
  2. /*
  3. UserSpice 4
  4. An Open Source PHP User Management System
  5. by the UserSpice Team at http://UserSpice.com
  6.  
  7. This program is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation, either version 3 of the License, or
  10. (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  19. */
  20.  
  21. /* DEVELOPER NOTE:
  22.    If you are having difficulty with your email configuration, go to
  23.    users/helpers/helpers.php (around line 114) and set $mail->SMTPDebug
  24.    to a non-zero value. This is a development-platform-ONLY setting - be
  25.    sure to set it back to zero (or leave it unset) on any live platform -
  26.    otherwise you would open significant security holes.
  27. */
  28. ?>
  29. <?php require_once 'init.php'; ?>
  30. <?php require_once $abs_us_root.$us_url_root.'users/includes/header.php'; ?>
  31. <?php require_once $abs_us_root.$us_url_root.'users/includes/navigation.php'; ?>
  32.  
  33. <?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
  34. <?php if($user->data()->id != 1){
  35.   Redirect::to('account.php');
  36. }
  37.   ?>
  38. <div id="page-wrapper">
  39.  
  40.   <div class="container-fluid">
  41.  
  42.     <!-- Page Heading -->
  43.     <div class="row">
  44.       <div class="col-sm-12">
  45.  
  46.         <!-- Main Center Column -->
  47.         <div class="class col-xs-12 col-sm-offset-1 col-sm-10 col-md-offset-2 col-md-8 col-lg-offset-3 col-lg-6">
  48.           <!-- Content Goes Here. Class width can be adjusted -->
  49.           <h1>
  50.             Test your email settings.
  51.           </h1><br>
  52.           It's a good idea to test to make sure you can actually receive system emails before forcing your users to verify theirs. <br><br>
  53.           <?php
  54.                 if (!empty($_POST)){
  55.             /* these appear to be unused
  56.             $query = $db->query("SELECT * FROM email");
  57.             $results = $query->first();
  58.             */
  59.  
  60.             $to = $_POST['test_acct'];
  61.             $subject = 'Testing Your Email Settings!';
  62.             $body = 'This is the body of your test email';
  63.             $mail_result=email($to,$subject,$body);
  64.  
  65.                     if($mail_result){
  66.                         echo '<div class="alert alert-success" role="alert">Mail sent successfully</div><br/>';
  67.                     }else{
  68.                         echo '<div class="alert alert-danger" role="alert">Mail ERROR</div><br/>';
  69.                     }
  70.                 }
  71.               ?>
  72.  
  73.           <form class="" name="test_email" action="email_test.php" method="post">
  74.             <label>Send test to (Ideally different than your from address):
  75.               <input required size='50' class='form-control' type='text' name='test_acct' value='' /></label>
  76.  
  77.               <label>&nbsp;</label><br />
  78.               <input class='btn btn-primary' type='submit' value='Send A Test Email' class='submit' />
  79.           </form>
  80.  
  81.           <!-- End of main content section
  82.         </div>
  83.  
  84.       </div>
  85.     </div>
  86.  
  87.     <!-- /.row -->
  88.  
  89.     <!-- footers -->
  90. <?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>
  91.  
  92.     <!-- Place any per-page javascript here -->
  93.  
  94. <?php require_once $abs_us_root.$us_url_root.'users/includes/html_footer.php'; // currently just the closing /body and /html ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement