【问题标题】:Symfony 1.4 sfmailer picking wrong host [closed]Symfony 1.4 sfmailer 选择错误的主机 [关闭]
【发布时间】:2012-10-09 05:25:58
【问题描述】:

我正在使用 symfony 1.4 和 propel 1.4

我在 factory.yml 中进行了以下设置

dev:
  mailer:
    class: sfMailer
    param:
      logging:           %SF_LOGGING_ENABLED%
      charset:           %SF_CHARSET%
      delivery_strategy: realtime
      transport:
        class: Swift_SmtpTransport
        params:
          host:     mail.myserver.com
          port:     26
          username: webmaster@myserver.com
          password: mypass

运行以下代码:

$mailer=$this->getMailer()->composeAndSend($from, $to, $subject, $message);

错误后的问题

Connection could not be established with host localhost [A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. #10060]

我的问题是,它正在尝试连接到 localhost,即使我在 factory.yml 中提供了不同的主机。谁能告诉我问题出在哪里?

【问题讨论】:

    标签: email symfony-1.4 swiftmailer


    【解决方案1】:

    工厂有错字。

    尝试将transport 下的params 更改为param,如果它存在于您的真实 factory.yml 中。

    【讨论】:

      猜你喜欢
      • 2019-07-14
      • 2011-10-13
      • 2016-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-07
      相关资源
      最近更新 更多