简体   繁体   中英

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. 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

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

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? thanks for reading!

The problem is that you don't have the ssl transport installed for php. 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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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