Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用symfony1.4 Swiftmailer从本地主机发送电子邮件_Php_Symfony 1.4_Swiftmailer_Orangehrm - Fatal编程技术网

Php 使用symfony1.4 Swiftmailer从本地主机发送电子邮件

Php 使用symfony1.4 Swiftmailer从本地主机发送电子邮件,php,symfony-1.4,swiftmailer,orangehrm,Php,Symfony 1.4,Swiftmailer,Orangehrm,我试图从localhost发送电子邮件,但收到此消息 03/14/15 10:28:31,121 [4924] ERROR filter.ExceptionCatcherFilter - Uncaught Exception: exception 'Swift_TransportException' with message 'Connection could not be established with host localhost [No connection could be made

我试图从localhost发送电子邮件,但收到此消息

 03/14/15 10:28:31,121 [4924] ERROR filter.ExceptionCatcherFilter - Uncaught Exception: 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:\wamp\www\erp9282014\symfony\lib\vendor\symfony\lib\vendor\swiftmailer\classes\Swift\Transport\StreamBuffer.php:235
我在factory.yml中的配置是

prod:
  mailer:
    class: sfMailer
    param:
      logging:           %SF_LOGGING_ENABLED%
      charset:           %SF_CHARSET%
      delivery_strategy: realtime
    transport:
      class: Swift_SmtpTransport
      param:
        host:       localhost
        port:       25
        encryption: ~
        username:   myname@gmail.com
        password:   my password
在我的动作文件中我使用

 $this->getMailer();
    $this->getMailer()->composeAndSend("erp@ahg.af","m@ahg.af"," LIVE","BODY");

我真的被困在这里了

最后,我想出了这个问题。问题出在我的在线服务器上。当我更换服务器时,一切都正常