简体   繁体   English

使用swiftmailer发送邮件时出现fsockopen问题

[英]having issue with fsockopen while sending mail with swiftmailer

I was playing around the new swiftmailer 4.0.4 using my zend studio embbeded apache server where i can send successfully emails through gmail smtp. 我使用zend studio嵌入式apache服务器在新的swiftmailer 4.0.4上玩耍,可以通过gmail smtp成功发送电子邮件。 Now that it's was fine and that i decided to use it in real project and this time along using xampp 1.6.8.any time i run the same function there is this error 现在一切都好了,我决定在实际项目中使用它,这一次使用xampp 1.6.8。每次我运行相同的功能时都会出现此错误

Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in C:\\xampp\\htdocs\\project\\includes\\swift\\classes\\Swift\\Transport\\StreamBuffer.php on line 243 警告:fsockopen()[function.fsockopen]:无法连接到ssl://smtp.gmail.com:465(无法找到套接字传输“ ssl”-您在配置PHP时是否忘记启用它?) C:\\ xampp \\ htdocs \\ project \\ includes \\ swift \\ classes \\ Swift \\ Transport \\ StreamBuffer.php在第243行

i've tried to enable ssl from xampp index file it has accepter the certificate but still my error won't disapear.I'm really concerned about this.Can anyone share his opinion or experience? 我试图从xampp索引文件中启用ssl,它具有接受者证书,但我的错误仍然不会消失。我真的很担心。有人可以分享他的意见或经验吗? thanks for reading! 谢谢阅读!

The problem is that you don't have the ssl transport installed for php. 问题是您没有为PHP安装ssl传输。 Different systems do this in different ways, so I don't know how yours would work. 不同的系统以不同的方式执行此操作,因此我不知道您的系统将如何工作。

You can run a quick php app to verify this: 您可以运行一个快速的php应用程序来验证这一点:

<?php

print_r(stream_get_transports());

Mine returns: 矿山退货:

Array
(
    [0] => tcp
    [1] => udp
    [2] => unix
    [3] => udg
    [4] => ssl
    [5] => sslv3
    [6] => sslv2
    [7] => tls
)

If ssl and tls are not there, then your php installation does not have support for them and you need to find a way to fix that. 如果ssl和tls不存在,则您的php安装不支持它们,您需要找到一种解决方法。

我认为由于某种原因它开始工作。我不确定发生了什么,我重新安装了xampp,再也看不到问题了。很奇怪。

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

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