2016-12-04 4 views
0

Ich benutze PHPMailer und habe andere versucht, aber das funktioniert einfach nicht. Ich bekomme immer wieder einen Fehler, dass der Server mir den Zugriff verweigert? Hier ist der Beispielcode verwendet:Godaddy - Office365 SMTP funktioniert nicht?

<?php 
require 'PHPMailerAutoload.php'; 
$mail = new PHPMailer; 
//$mail->SMTPDebug = 3;        // Enable verbose debug output 
$mail->isSMTP();          // Set mailer to use SMTP 
$mail->Host = 'smtp.office365.com'; // Specify main and backup SMTP servers 
$mail->SMTPAuth = true;        // Enable SMTP authentication 
$mail->Username = '[email protected]';     // SMTP username 
$mail->Password = 'xxx';       // SMTP password 
$mail->SMTPSecure = 'tls';       // Enable TLS encryption, `ssl` also accepted 
$mail->Port = 587;         // TCP port to connect to 

$mail->setFrom('[email protected]', 'Mailer'); 
$mail->addAddress('[email protected]', 'Joe User');  // Add a recipient 
$mail->addReplyTo('[email protected]', 'Information'); 
$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'; 

if(!$mail->send()) { 
echo 'Message could not be sent.'; 
echo 'Mailer Error: ' . $mail->ErrorInfo; 
} else { 
echo 'Message has been sent'; 
} 

Ich bin mit den gleichen Einstellungen wie in der offiziellen Dokumentation gezeigt: https://support.office.com/en-gb/article/POP-and-IMAP-settings-for-Outlook-Office-365-for-business-7fc677eb-2491-4cbc-8153-8e7113525f6c

Was scheint ein Problem zu sein? Ich habe online in einer Reihe von Posts nachgesehen, aber nichts scheint zu funktionieren. Irgendwelche Ideen??

+3

voller Fehler bitte – Blag

+1

Mögliche Duplikat [Office365 über GoDaddy SMTP funktioniert nicht?] (Http://stackoverflow.com/questions/41089257/office365-via-godaddy-smtp-does-not-work) – Synchro

Antwort

0

auf einem wirtschaftliches Hosting smtp nicht funktioniert, folgen Sie bitte der Lösung Mail-Treiber unten aufgeführten

MAIL_DRIVER=mail 
    MAIL_HOST=smtp.office365.com 
    MAIL_PORT=587 
    MAIL_USERNAME=office365_email 
    MAIL_PASSWORD=office365_password 
    MAIL_FORM=office365_email 
    MAIL_ENCRYPTION=tls 

Die E-Mail ca. 2-5 Minuten in Anspruch nehmen zu liefern, aber es ist die Arbeitslösung. Dank

Verwandte Themen