我正在使用symfony 1.4 with propel 1.4
我在factories.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,即使我在factories.yml中给出了不同的主机。谁能告诉我问题在哪里?
答案 0 :(得分:1)
工厂存在拼写错误。
尝试将params
更改为param
下的transport
,如果它存在于您的真实工厂中。