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