Hej:) podpowie mi ktoś z Was w której linijce zrobiłam błąd, że po wypełnieniu formularza na www i kliknięciu "wyślij" po dłuższym czasie pojawia się napis "405 Not Allowed" ?
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require __DIR__ . 'vendor/autoload.php';
$mail = new PHPMailer; // Passing `true` enables exceptions
try {
//Server settings
// $mail->SMTPDebug = 2; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = '*******.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'art@********.com'; // SMTP username
$mail->Password = '*******'; // SMTP password
$mail->SMTPSecure = 'TLS'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = ****; // TCP port to connect to
//Recipients
$mail->setFrom('art@*********.com', ' *****');
$mail->addAddress('art@*********.com', '*****'); // Add a recipient name is optional
$mail->addReplyTo('info@example.com', 'Information');
// $mail->addCC('cc@example.com');
// $mail->addBCC('bcc@example.com');
//Attachments
// $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
// $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$html = new \Html2Text\Html2Text($mail->Body);
$mail->AltBody = $html->getText();
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
}
?>