Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. include "PHPMailer_5.2.4/class.phpmailer.php";
  2. $mail = new PHPMailer();
  3.  
  4. $mail->IsSMTP();
  5. $mail->SMTPDebug = 1;
  6. $mail->SMTPAuth = true;
  7. $mail->SMTPSecure = 'ssl';
  8. $mail->Host = "smtp.gmail.com";
  9. $mail->Port = 465;
  10. $mail->IsHTML(true);
  11. $mail->Username = "nida.office123@gmail.com";
  12. $mail->Password = "*************";
  13. $mail->AddAddress($to,$nameM );
  14. $mail->Subject = "Payment Request";
  15. $mail->Body = "<b>A payment request has been made. Please visit your panel and accept or disapprove the request.Visit the link below to perform the action. <center><a href="http://localhost/internshippro/login.php">Login to continue</a></center></b>";
  16. $text = 'Text version of email';
  17. $html = '<html><body>HTML version of email</body></html>';
  18. $file = 'index.php';
  19. $crlf = "n";
  20. $hdrs = array(
  21. 'email' => 'example@gmail.com',
  22. 'Subject' => 'Test subject message',
  23. 'comment' => 'Test comment',
  24. );
  25. if ($mail->send($hdrs))
  26. //if (mail($subject,$message, $headers))
  27. {
  28. echo "<script> alert('Thank you for contacting us!');window.location = '';</script>";
  29. } else {
  30. echo "Mailed Error: " . $mail->ErrorInfo;
  31. }
  32.  
  33. SMTP -> ERROR: Failed to connect to server: (0)
  34. The following From address failed: root@localhost : Called Mail() without
  35. being connected Mailed Error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement