2016-10-01 68 views
0

我已經下載了swiftmailer文件庫來集成到我的應用程序中,並且在定義我的sendmail變量之後,我遇到以下錯誤。我該如何配置php swiftmailer發送電子郵件

Fatal error: Uncaught exception 'Swift_TransportException' with message 'Connection could not be established with host localhost [No connection could be made because the target machine actively refused it. #10061]' in C:\xampp\htdocs\ordering\admin\lib\classes\Swift\Transport\StreamBuffer.php:266 Stack trace: #0 C:\xampp\htdocs\ordering\admin\lib\classes\Swift\Transport\StreamBuffer.php(64): Swift_Transport_StreamBuffer->_establishSocketConnection() #1 C:\xampp\htdocs\ordering\admin\lib\classes\Swift\Transport\AbstractSmtpTransport.php(115): Swift_Transport_StreamBuffer->initialize(Array) #2 C:\xampp\htdocs\ordering\admin\lib\classes\Swift\Mailer.php(80): Swift_Transport_AbstractSmtpTransport->start() #3 C:\xampp\htdocs\ordering\admin\send_mail.php(43): Swift_Mailer->send(Object(Swift_Message)) #4 C:\xampp\htdocs\ordering\admin\update_status_divident.php(48): sendMail('[email protected]', 'Gandepuun', '[email protected]', 'SUCCESSGANDE', 12345, 'localhost') #5 {main} thrown in C:\xampp\htdocs\ordering\admin\lib\classes\Swift\Transport\StreamBuffer.php on line 266 

這裏是我的變量

<? 
$MyEmail=ShowEmail($member_id); 
$rs=mysql_fetch_assoc($MyEmail); 
$email=$rs['Email']; 
$username=$rs['memberID']; 

$Mamail='[email protected]'; 
$Mapwd='Gandepuun'; 


$applicationid=12345; 
$instanceadd='localhost'; 
sendMail($Mamail,$Mapwd,$email,$username,$applicationid,$instanceadd); 

有人請幫我應該是什麼$instanceadd 等待您的提示答案的變量,請。

回答

0

我還沒有使用過swiftmailer,但它看起來像是試圖與本地計算機上的SMTP服務通話,但是本地計算機拒絕它,要麼是因爲服務被防火牆,要麼您沒有安裝SMTP服務。

相關問題