2020-09-30 19:10:03 SERVER -> CLIENT:
2020-09-30 19:10:03 CLIENT -> SERVER: EHLOwww.nnn.com
2020-09-30 19:10:03 SERVER -> CLIENT:
2020-09-30 19:10:03 SMTP ERROR: EHLO command failed:
2020-09-30 19:10:03 CLIENT -> SERVER: HELOwww.nnn.com
2020-09-30 19:10:03 SERVER -> CLIENT:
2020-09-30 19:10:03 SMTP ERROR: HELO command failed:
SMTP Error: Could not authenticate.
2020-09-30 19:10:03 CLIENT -> SERVER: QUIT
2020-09-30 19:10:03 SERVER -> CLIENT:
2020-09-30 19:10:03 SMTP ERROR: QUIT command failed:
SMTP Error: Could not authenticate.



Wamp Üzerinde Çalışan Kodlar Hosting Üzerinde Çalışmıyor.
PHP 7.3






use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;




function MailPrepare($hedefeposta,$hedefisim,$konu,$mesaj,$hataliyonlendirme,$basariliyonlendirme) {

$db = new db;
$data = new Data($db->bag());
$settings = $data->settings();


$mail = new PHPMailer(true);





$mail->SMTPDebug = 2; //SMTP::DEBUG_SERVER;
$mail->isSMTP();
$mail->Priority= 1;

$mail->Host = gethostbyname($settings["email_server"]); // gethostbyname($settings["email_server"]);
$mail->SMTPAuth = true;
$mail->Username = $settings["system_email"];
$mail->Password = $settings["system_email_password"];
$mail->SMTPAutoTLS = false;
$mail->Helo = $settings["url"];

if ($settings["email_secure"]=="ssl") {
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
} else if ($settings["email_secure"]=="tls") {
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
} else {
$mail->SMTPSecure = "";
}

$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
$mail->Hostname = $settings["url"];
$mail->Port = $settings["email_port"];
$mail->setFrom($settings["system_email"], $settings["title"]);
$mail->addAddress($hedefeposta, $hedefisim);
$mail->isHTML(true);
$mail->Subject = $konu;
$mail->Body = $mesaj;
$mail->AltBody = 'Bu E-Postaya Geri Dönüş Yapmanıza Gerek Yoktur';
try {

$mail->send();
start_redirection($basariliyonlendirme);
} catch (Exception $e) {

echo "
";

print_r($mail);
echo "
";
echo "
";
start_redirection($hataliyonlendirme."&s=".$e->ErrorInfo()."");
}



}