Ich versuche SMTP-E-Mails mit PHPMailer zu senden, aber ich bekomme diese Fehlermeldung, irgendwelche Ideen, wie man es loswerden?
Ich versuche, über SSL auf Port 465.Senden von E-Mails über SMTP mit PHPMailer
SMTP -> FROM SERVER:
SMTP -> FROM SERVER:
SMTP -> ERROR: EHLO not accepted from server:
Notice: fputs() [function.fputs]: send of 18 bytes failed with errno=32 Roura přerušena (SIGPIPE) in /home/www/amazonek.cz/subdomains/library/PHPMailer_v5.1/class.smtp.php on line 494
SMTP -> FROM SERVER:
SMTP -> ERROR: HELO not accepted from server:
Notice: fputs() [function.fputs]: send of 12 bytes failed with errno=32 Roura přerušena (SIGPIPE) in /home/www/amazonek.cz/subdomains/library/PHPMailer_v5.1/class.smtp.php on line 212
SMTP -> ERROR: AUTH not accepted from server:
SMTP Error: Could not authenticate.
Mein Code zu verbinden:
require_once('../library/PHPMailer_v5.1/class.phpmailer.php');
try{
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = SMTP_SERVER;
$mail->Port = SMTP_PORT;
$mail->Username = SMTP_USERNAME;
$mail->Password = SMTP_PASSWORD;
$mail->SMTPDebug = 2;
$mail->SetFrom(MAIL_ORDERS_ADDRESS, MAIL_ORDERS_NAME);
$mail->Subject = 'AMAZONEK.cz - objednávka číslo '.$_SESSION['orderId'];
$mail->MsgHTML('<b>Ahoj</b>');
$mail->AddAddress($_SESSION['user']['email'], $_SESSION['user']['name'].' '.$_SESSION['user']['surname']);
$mail->AddBCC(MAIL_ORDERS_ADDRESS, MAIL_ORDERS_NAME);
if(!$mail->Send()) throw new Exception($mail->ErrorInfo);
}
catch(Exception $e){
echo $e->getMessage();
}
Konstanten Definition:
define('SMTP_SERVER', 'smtp.ebola.cz');
define('SMTP_PORT', 465);
define('SMTP_USERNAME', '[email protected]');
define('SMTP_PASSWORD', '***CENSORED***');
define('MAIL_ORDERS_ADDRESS', '[email protected]');
define('MAIL_ORDERS_NAME', 'My Name');
Irgendwelche Ideen?
Dies tatsächlich geholfen, ich nicht, dass ich wusste brauche 'ssl' Präfix, wenn der SMTP-Provider dies nicht angibt. Vielen Dank. – cypher
Sie könnten auch Ihren Hostnamen mit dem Protokoll voranstellen (d. H. '$ Mail-> Host =" tls: // ".SMTP_SERVER;') UND verwenden 'port 465' –