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

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
bundy
Forum Newbie
Posts: 15
Joined: Mon Jun 04, 2007 7:04 pm

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

Post 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]
judas_iscariote
Forum Newbie
Posts: 2
Joined: Mon Mar 27, 2006 9:48 pm

Post by judas_iscariote »

you need the openssl extension loaded, PHP needs it to be able to use SSL properly.
bundy
Forum Newbie
Posts: 15
Joined: Mon Jun 04, 2007 7:04 pm

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