Advertisement
Guest User

Untitled

a guest
Apr 10th, 2017
593
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. <?php
  2.  
  3. if ($_SERVER['REQUEST_METHOD'] == 'POST') {
  4. $status = $_POST['status'];
  5. $uname = $_POST['uname'];
  6. $dept = $_POST['dept'];
  7. $ename = $_POST['ename'];
  8.  
  9. require_once('dbConnect.php');
  10.  
  11. $sql = "SELECT name,email FROM user WHERE mobile='" . $uname . "'";
  12. $check = mysqli_fetch_row(mysqli_query($con, $sql));
  13. $username = $check[0];
  14. $email = $check[1];
  15.  
  16. require_once 'smsapi/way2sms-api.php';
  17. sendWay2SMS('username', 'password', $uname,' Message');
  18.  
  19. require_once 'mailapi/PHPMailerAutoload.php';
  20. $mail = new PHPMailer;
  21.  
  22. $mail->isSMTP(); // Set mailer to use SMTP
  23. $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
  24. $mail->SMTPAuth = true; // Enable SMTP authentication
  25. $mail->Username = 'username@gmail.com'; // SMTP username
  26. $mail->Password = 'password'; // SMTP password
  27. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  28. $mail->Port = 587; // TCP port to connect to
  29. $mail->setFrom('username@gmail.com', 'Name');
  30. $mail->addAddress($email, $username);
  31. $mail->isHTML(true);
  32. $mail->Subject = 'Subject';
  33. $mail->Body = 'Message';
  34. !$mail->send();
  35. }
  36. ?>
  37.  
  38. <?php
  39. require_once 'smsapi/way2sms-api.php';
  40. sendWay2SMS('username', 'password', $uname,' Message');
  41. ?>
  42.  
  43. <?php
  44. require_once 'mailapi/PHPMailerAutoload.php';
  45. $mail = new PHPMailer;
  46.  
  47. $mail->isSMTP(); // Set mailer to use SMTP
  48. $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
  49. $mail->SMTPAuth = true; // Enable SMTP authentication
  50. $mail->Username = 'username@gmail.com'; // SMTP username
  51. $mail->Password = 'password'; // SMTP password
  52. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  53. $mail->Port = 587; // TCP port to connect to
  54. $mail->setFrom('username@gmail.com', 'Name');
  55. $mail->addAddress($email, $username);
  56. $mail->isHTML(true);
  57. $mail->Subject = 'Subject';
  58. $mail->Body = 'Message';
  59. !$mail->send();
  60. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement