Page 1 of 1

fsockopen returned Error Number 2243672 on local PC

Posted: Sat Mar 15, 2008 7:02 am
by anjanesh
Hi

I just setup a Apache 2.2.8& PHP 5.2.5 on a new PC.
Tried sending a batch-mail.

Code: Select all

require_once "../lib/Swift.php";
require_once "../lib/Swift/Connection/SMTP.php";
 
$body = file_get_contents("content.html") or die('Couldnt get html file');
 
$smtp = new Swift_Connection_SMTP("smtp.gmail.com", Swift_Connection_SMTP::PORT_SECURE, Swift_Connection_SMTP::ENC_TLS);
$smtp->setUsername("username@gmail.com");
$smtp->setpassword("password");
# $smtp->setTimeout(2);
 
$message = new Swift_Message("Subject", $body);
 
$swift = new Swift($smtp);
 
$recipients = new Swift_RecipientList();
$recipients->addTo("user1@domain.com", "Recipient 1");
$recipients->addTo("user2@domain.com", "Recipient 2");
 
$swift->batchSend($message, $recipients, new Swift_Address("myname@domain.com", "my name"));

Code: Select all

PHP Fatal error:  Uncaught exception 'Swift_ConnectionException' with message 'The SMTP connection failed to start [tls://smtp.gmail.com:465]: fsockopen returned Error Number 2243672 and Error String 'Unable to find the socket transport "tls" - did you forget to enable it when you configured PHP?'' in E:\htdocs\3rdParty\Swift-3.3.2-php5\lib\Swift\Connection\SMTP.php:309
What do I have to enable in php.ini ? I've enabled almost all the extensions.

Thanks

Re: fsockopen returned Error Number 2243672 on local PC

Posted: Sat Mar 15, 2008 8:35 am
by Chris Corbyn
I'm not sure how TLS works on windows machines since it's provided by OpenSSL which is a UNIX library. I imagine there's some static module for it or something but my windows + PHP knowledge is very bad I'm afraid.