Gibt es etwas, das mir fehlt? Ich habe hoch und niedrig gesucht und bin mir nicht sicher, was mit meinem Code nicht stimmt. Ist es auch, dass ich öffentliche statt Mail benutze?SMTP Mit Google Mail-Fehler. Ich erhalte die E-Mail nicht
<?php
require_once('phpmailer.php');
class Mail extends PhpMailer
{
// Set default variables for all new objects
public $mail = IsSMTP;
public $From = '[email protected]';
public $FromName = SITETITLE;
public $Host = 'smtp.gmail.com';
public $port = 587;
public $Mailer = 'smtp';
public $SMTPAuth = true;
public $Username = '[email protected]';
public $Password = 'password';
public $SMTPSecure = 'tls';
public $WordWrap = 75;
public function subject($subject)
{
$this->Subject = $subject;
}
public function body($body)
{
$this->Body = $body;
}
public function send()
{
$this->AltBody = strip_tags(stripslashes($this->Body))."\n\n";
$this->AltBody = str_replace(" ", "\n\n", $this->AltBody);
return parent::send();
}
}
Dies ist mein aktueller Code, und das Problem wurde nicht gelöst. Irgendwelche neuen Ideen?
ich beide 587 versucht habe, und 465. – Jayy
Mögliche Duplikat von [PHPMailer SMTP ERROR: Verbindung zum Server konnte nicht hergestellt werden] (http://stackoverflow.com/questions/36351817/phpmailer-smtp-error-failed-to-connect-to-server) – brimstone
kann nicht einfach verwendet werden Google Mail-Server, um Leute zu spammen. – user2260040