无法使用symfony2.3应用程序中的swiftmailer通过gmail发送电子邮件

无法使用symfony2.3应用程序中的swiftmailer通过gmail发送电子邮件,symfony,swiftmailer,Symfony,Swiftmailer,我正在尝试使用gmail配置发送电子邮件,但我不能。 我没有任何错误;我还检查了symfony日志文件。 没有崩溃,但没有发送电子邮件:( 我还运行了swiftmailer:spool:send命令(可能邮件在spool中),结果收到:发送了0封邮件 我正在使用dev环境,在我的config_dev.yml中: swiftmailer: transport: gmail username: myuser@gmail.com password: mypass 在控制器

我正在尝试使用gmail配置发送电子邮件,但我不能。 我没有任何错误;我还检查了symfony日志文件。 没有崩溃,但没有发送电子邮件:( 我还运行了swiftmailer:spool:send命令(可能邮件在spool中),结果收到:发送了0封邮件

我正在使用dev环境,在我的config_dev.yml中:

swiftmailer:
    transport: gmail
    username:  myuser@gmail.com
    password:  mypass
在控制器中(仅用于测试):

提前谢谢

更新: 我切换到prod环境,结果相同:没有错误…直到我运行命令并得到此错误:

[Swift_TransportException]                                                   
Connection could not be established with host smtp.gmail.com [Unable to fin  
d the socket transport "ssl" - did you forget to enable it when you configu  
red PHP? #50346848]                                                          
然后,我在php.ini中取消注释这一行

extension=php_openssl.dll
但没有,结果是一样的:(

我还将内存修改为swiftmailer配置中的文件,并且电子邮件在缓存中:

app\cache\prod\swiftmailer\spool

PS:我不支持任何代理

您是否检查了探查器(您可以知道是否发送了一些电子邮件,或者至少是假脱机的)?您是否在prod环境中尝试过


我记得在我做的一个项目中,Swiftmailer在开发环境中遇到了类似的问题。为了测试它,我将
spool:{type:memory}
更改为
spool:{type:file}
我检查了dev cache目录中的邮件。

我没有在prod环境中尝试,我会的。我也会按文件更改内存,谢谢你的提示,我会让你know@Oriam我刚刚看到
我还将内存修改为swiftmailer配置中的文件,并且电子邮件在缓存中:
中。之后是否使用了spool命令?是的现在我没有收到任何错误(当我使用命令时),但是电子邮件没有发送。
app\cache\prod\swiftmailer\spool