Exchange認証を使用してswiftメーラーでメールを送信しようとしています。しかし、なぜそれが機能しないのか理解できないようです。
<?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( "from@address.com" ) )
->setTo( array( "to@address.com" ) )
->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 の開始後にのみ基本認証を提供します)。
一部の人々が TLS 暗号化にポート 587 を使用しているのを見ましたが、ポート 587 で接続できません。エラーが発生します。Connection could not be established with host 31.149.66.10 [No route to host #113].
誰かが私が間違っていることを見ることができますか?