简体   繁体   English

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

[英]Send email from localhost using symfony1.4 Swiftmailer

I am trying to send email from localhost, but i get this message. 我正在尝试从本地主机发送电子邮件,但收到此消息。

 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

My configuration in factory.yml is 我在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

and in my action files i use. 在我的动作文件中

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

I am really stuck in here 我真的被困在这里

Finally, I come up with this problem. 最后,我想出了这个问题。 The problem was with my online server. 问题出在我的在线服务器上。 when i changed my server, and every thing worked find. 当我更换服务器时,一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM