0
PHPMailer를 제대로 설정하여 서버에서 작동되게하려면 어떻게해야합니까?PHPMailer 6 작곡가가 작동하지 않습니다.
제공된 예제와 같이 설정했습니다.
하나의 파일을 업로드했습니다. 파일이 실행되었지만 모두 내가 얻은 것은 500 내부 서버 오류입니다.
=============== 편집 ===============
문제는 PHP 버전 5.3.3 될 것으로 보인다
이 설치는 PHP 버전^7
에서 작동합니다.
서버 설정
/ root
- uploads.php
- form.html
- vendor (dir)
- composer (dir)
- phpmailer (dir)
- autoload.php
.
form.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form action="upload.php" method="POST" enctype="multipart/form-data">
<input type="file" name="file">
<button type="submit" name="submit">Upload</button>
</form>
</body>
</html>
.
upload.php로
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require './vendor/autoload.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$mail = new PHPMailer; // <-- error on this line
echo "after phpmailer"; // <-- does not run
// phpmailer code here ...
}