Ich habe versucht, eine Mail mit PHP-Mailer auf Xampp zu senden, und ich bekomme diese Fehlermeldung Nachricht konnte nicht gesendet werden. Mailer Error: Die folgende Absenderadresse ist fehlgeschlagen: [email protected]: Called Mail() ohne Verbindungwie man Post sendet mit phpmailer auf xampp
bitte, ich brauche Hilfe, wie Sie das beheben können. Hier ist mein Code;
<?php
require('class.phpmailer.php');
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = "tls://smtp.gmail.com";
$mail->Port = 25;
$mail->Username = "[email protected]";
$mail->Password = "xxxxx";
//Sending the actual email
$mail->setFrom('[email protected]', 'Aaron');
$mail->addAddress('[email protected]', 'Aaron'); // Add a recipient
$mail->isHTML(false); // Set email format to HTML
$mail->Subject = 'Calculation form results from ';
$mail->Body = 'testing...';
if(!$mail->send()) {
echo 'Message could not be sent. ';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
?>
Nach dem Tutorial von phpmailer sollten Sie 'require 'PHPMailerAutoload.php' verwenden;'. Es sollte auch '$ mail = new PHPMailer();' sein. https://github.com/PHPMailer/PHPMailer/wiki/Tutorial – IcedAnt
https://support.google.com/mail/answer/7104828?hl=de&visit_id=1-636410671215867907-2344642736&rd=3 Ihr Port ist falsch. Versuchen Sie 587 für TLS. – IcedAnt
'$ mail-> Host =" tls: //smtp.gmail.com "; $ mail-> Port = 587; 'immer noch der gleiche Fehler –