Page 1 of 1

Do i have to install something in order to use ssl in php

Posted: Thu Jun 28, 2007 9:52 pm
by bundy
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello everyone

 I have used swiftmailler and had a error like this: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?... 

I am using swiftmailer to connect with the smtp server in google and receive an error like this...

Code: Select all

$host = "smtp.gmail.com";
 $port =  465;
 $username = "something@gmail.com";
 $pass = "googlepass";

 $from = "something@gmail.com";
 $to = "receiver@yahoo.com";

 $msg = "Hello i am simon";

 $conn = new Swift_Connection_SMTP($host, $port, Swift_Connection_SMTP::ENC_SSL);
 $conn->attachAuthenticator(new Swift_Authenticator_LOGIN($host));

 $conn->setUsername($username);
 $conn->setPassword($pass);
 
 
 $swifts = new Swift($conn);
 
 $message = new Swift_Message("Smoke Test 1 - Basic");
      
 $message->setBody("This is just a basic test\n"); 

 $to = new Swift_Address($to, "Name To");
 $from = new Swift_Address($form, "blah");
 
 $swifts->send($message, $to, $from);
Please help .. I have tried alot of things before i post in the forum but none of them works.


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Thu Jun 28, 2007 11:36 pm
by judas_iscariote
you need the openssl extension loaded, PHP needs it to be able to use SSL properly.

Posted: Fri Jun 29, 2007 12:00 am
by bundy
judas_iscariote wrote:you need the openssl extension loaded, PHP needs it to be able to use SSL properly.
Thanks, i have done this and it said "PHP Warning: Module 'openssl' already loaded in Unknown on line 0". Does that mean the module already been loaded. Do I need to do anything with the file openssl.cnf to creat certificate or stuff .....in order to use it....