使用symfony1.4 Swiftmailer从localhost发送电子邮件

时间:2015-03-14 09:39:07

标签: 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 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");

我真的被困在这里

1 个答案:

答案 0 :(得分:0)

最后,我想出了这个问题。问题出在我的在线服务器上。当我改变我的服务器时,每件事都找不到。