Guest User

Untitled

a guest
Dec 4th, 2017
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. PHP Parse error: syntax error, unexpected 'new' (T_NEW) in C:xampphtdocsATOZqdmail.php on line 661
  2.  
  3. use PHPMailerPHPMailerPHPMailer;
  4. use PHPMailerPHPMailerException;
  5.  
  6. require 'Exception.php';
  7. require 'PHPMailer.php';
  8. require 'SMTP.php';
  9.  
  10. $mail = new PHPMailer(true); // Passing `true` enables exceptions
  11. try {
  12. $mail->IsSMTP();
  13. $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
  14. $mail->SMTPAuth = true;
  15. //$mail->CharSet = 'utf-8';
  16. //$mail->SMTPSecure = 'tls';
  17. $mail->Host = "smtp.hoge.jp";
  18. $mail->Port = 587;
  19. $mail->IsHTML(false);
  20. $mail->Username = 'a@hoge.com';
  21. $mail->Password = 'hogehoge';
  22. $mail->SetFrom('a@hoge.com');
  23. $mail->From = 'a@hoge.com';
  24. $mail->Subject = 'test send';
  25. $mail->Body = 'test send';
  26. $mail->AddAddress('piyo@hoge.com');
  27. $mail->send();
  28.  
  29. } catch (Exception $e) {
  30. echo $mail->ErrorInfo;
  31. }
Add Comment
Please, Sign In to add comment