我已经下载了swiftmailer文件库以集成到我的应用程序中,在定义了我的sendmail变量后,我遇到以下错误。
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('nabem.jude@gmai...', 'Gandepuun', 'igbehg@gmail.co...', '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='nabem.jude@gmail.com';
$Mapwd='Gandepuun';
$applicationid=12345;
$instanceadd='localhost';
sendMail($Mamail,$Mapwd,$email,$username,$applicationid,$instanceadd);
有人请帮助我$instanceadd
的变量应该是什么
请等待你的快速答案。
答案 0 :(得分:0)
我没有使用swiftmailer,但看起来它试图与本地计算机上的SMTP服务通信,但是本地计算机拒绝它,因为服务是防火墙的,或者您没有安装SMTP服务。