Bauhu
Thanks for your reply!
I get the following error:
Invalid host: 0de”
SMTP Error: Could not connect to SMTP host.
Message could not be sent. Mailer Error: SMTP Error: Could not connect to SMTP host.
My index.php:
<?php
$p = $_GET;
if($p[‘pass’] != “sitePass”) {
die(‘message’);
}
//Import PHPMailer classes into the global namespace
//These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
//Load Composer’s autoloader
require ‘vendor/autoload.php’;
//Create an instance; passing true
enables exceptions
$mail = new PHPMailer(true);
try {
//Server settings
$mail->IsSMTP();
$mail->Host = “mail.myDomain.de”;
// $mail->SMTPAuth = true;
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //USE SSL
$mail->Port = 587; //SSL PORT
$mail->SMTPDebug = SMTP:😃EBUG_SERVER;
//Recipients
// $mail->setFrom('from@example.com', 'Mailer');
$mail->addAddress('example@example.com'); //Add a recipient
//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>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo “Message could not be sent. Mailer Error: {$mail->ErrorInfo}”;
}
?>
<?php