我想使用Exchange身份驗證發送郵件與迅捷郵件。但是,我似乎無法弄清楚爲什麼它不起作用。使用交換身份驗證發送電子郵件與快捷郵件
<?php
require_once("./application/helpers/swift/swift_required.php");
$transport =
Swift_SmtpTransport::newInstance("31.149.66.10", 25)
->setUsername("username")
->setPassword('password')
->setEncryption("tls");
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance("onderwerp")
->setFrom(array("[email protected]"))
->setTo(array("[email protected]"))
->setBody("Body van het bericht");
var_dump($mailer->send($message));
?>
這給我的錯誤:Uncaught exception 'Swift_TransportException' with message 'Failed to authenticate on SMTP server with username "nieuwsbrief" using 0 possible authenticators'.
服務器配置爲使用TLS和基本身份驗證(僅在啓動TLS後提供基本的身份驗證)。
我看到一些人使用端口587 TLS加密,但我不能在端口587也給出了錯誤連接:Connection could not be established with host 31.149.66.10 [No route to host #113].
任何人都可以看到我在做什麼錯?