Advertisement
Guest User

Untitled

a guest
Aug 14th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. <?php
  2. if (isset($_POST["send"])){
  3. if ($_SERVER['REQUEST_METHOD'] == 'POST'){
  4. require 'PHPMailerAutoload.php';
  5. require 'class.phpmailer.php';
  6.  
  7. $mail = new PHPMailer;
  8.  
  9. $mail->isSMTP();
  10. $mail->Host = 'smtp.mail.yahoo.com';
  11. $mail->SMTPAuth = true;
  12. $mail->Username = 'Asiasat_annex@yahoo.com.hk';
  13. $mail->Password = 'satellite20!5';
  14. $mail->SMTPSecure = 'tls';
  15.  
  16. $mail->From = 'Asiasat_annex@yahoo.com.hk';
  17. $mail->FromName = 'Spectrum Management';
  18. $mail->addAddress($_POST['Receive']);
  19.  
  20. if (isset($_POST['Receive2']))
  21. $mail->addAddress($_POST['Receive2']);
  22.  
  23. $mail->WordWrap = 50;
  24. $mail->isHTML(true);
  25.  
  26. $mail->Subject = $_POST['Subject'];
  27. $mail->Body = $_POST['Content'];
  28.  
  29. if(!$mail->send()) {
  30. echo '<h4>Post failed: Message could not be sent.</h4>';
  31. echo 'Mailer Error: ' . $mail->ErrorInfo;
  32. } else {
  33. echo '<h4>Post successfully: Message has been sent</h4>';
  34. }
  35. }
  36. $_POST['Receive']="";
  37. $_POST['Receive2']="";
  38. }
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement