sky*_*gle 0 email symfony1 swiftmailer
当我尝试使用Symfony框架发送电子邮件时,我收到此错误.我有一段时间没有这个问题和rember(含糊地),我必须更改我的php.ini设置并将它们与我的/app/config/factories.yml匹配才能使它工作.
不幸的是,我最近不得不重建我的机器,邮件现在已停止工作了 - 不幸的是,我不记得上次我做了什么工作.
这是我的app/config/factories.yml文件内容的片段:
all:
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: ~
password: ~
Run Code Online (Sandbox Code Playgroud)
注意:由于被粘贴在此控制台中,上面的内容可能是错误的 - 不要被它跟踪.YML在我的机器上很好用.
这是我尝试发送电子邮件时记录的错误消息:
[19-Feb-2011 14:50:13] PHP 20. userActions->executeRegisterComplete() /lib/vendor/symfony/symfony-1.3.8/lib/action/sfActions.class.php:60
[19-Feb-2011 14:50:13] PHP 21. sfMailer->send() /path/to/actions.class.php:355
[19-Feb-2011 14:50:13] PHP 22. Swift_Mailer->send() /lib/vendor/symfony/symfony-1.3.8/lib/mailer/sfMailer.class.php:300
[19-Feb-2011 14:50:13] PHP 23. Swift_Transport_AbstractSmtpTransport->start() /lib/vendor/symfony/symfony-1.3.8/lib/vendor/swiftmailer/classes/Swift/Mailer.php:74
[19-Feb-2011 14:50:13] PHP 24. Swift_Transport_StreamBuffer->initialize() /lib/vendor/symfony/symfony-1.3.8/lib/vendor/swiftmailer/classes/Swift/Transport/AbstractSmtpTransport.php:101
[19-Feb-2011 14:50:13] PHP 25. Swift_Transport_StreamBuffer->_establishSocketConnection() /lib/vendor/symfony/symfony-1.3.8/lib/vendor/swiftmailer/classes/Swift/Transport/StreamBuffer.php:70
[19-Feb-2011 14:50:13] PHP 26. fsockopen() /lib/vendor/symfony/symfony-1.3.8/lib/vendor/swiftmailer/classes/Swift/Transport/StreamBuffer.php:233
[19-Feb-2011 14:50:13] Connection could not be established with host localhost [Connection refused #111]
Run Code Online (Sandbox Code Playgroud)
我总是喜欢并且总是有所作为; 我根本就不使用localhost smtp服务.
all:
mailer:
param:
transport:
class: Swift_SmtpTransport
param:
host: smtp.gmail.com
port: 465
encryption: ssl
username: "xxx@gmail.com"
password: xxx-password
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12074 次 |
| 最近记录: |