Jump to content
The Uniform Server Community
Steve

Pear mail & SSL

Recommended Posts

Reference the following code segment...

 

require_once "Mail.php";

 

$host = "ssl://smtp.att.yahoo.com"; //as directed from AT&T

$port = "465"; // as directed from AT&T

.

.

.

$headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject);

$smtp = Mail::factory('smtp',

array ('host' => $host,

'port' => $port,

'auth' => true,

'username' => $username,

'password' => $password));

$mail = $smtp->send($to, $headers, $body);

 

if (PEAR::isError($mail)) {

echo("<p>" . $mail->getMessage() . "</p>");

} else {

echo("<p>Message successfully sent!</p>");

 

This produces the error ...

 

Failed to connect to ssl://smtp.att.yahoo.com:465 [sMTP: Failed to connect socket: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (code: -1, response: )]

 

I have searched through the PHP docs for any mention of SSL enable with no luck. I also searched Pear, again with no luck.

 

One more item that may be of significance, I am running this on 'localhost', not on an external server. Does that have any effect?

 

Any advice will be greatly appreciated

Thanks

Steve Albrecht

}

Share this post


Link to post
Share on other sites

You need to enable SSL support in PHP, I have never done this hence cannot provide a step-by-step guide. However the following is a very rough guide.

 

1) You need to download a full copy of PHP this allows you to pick-up the file php_openssl.dll place this in folder *\Uniform Server\udrive\usr\local\php\extensions

 

2) Enable this extension in php.ini located in folder *\Uniform Server\udrive\usr\local\php by changing this line

 

;extension=php_openssl.dll

To

extension=php_openssl.dll

 

3) Check out this page http://us.php.net/openssl to add open ssl

 

All the best

Ric

Share this post


Link to post
Share on other sites

I have taken a look at the files you need they are php_openssl.dll, libeay32.dll and ssleay32.dll you must use php_openssl.dll version 5.2.3.3

 

libeay32.dll and ssleay32.dll must match each other and be the latest versions otherwise you will receive an ordinal 3879 error.

 

I have done the legwork for you see attachment ssl_php.exe save to any folder; double click on the file to extract files.

 

Copy the files to the folders as shown below:

php_openssl.dll to folder *\Uniform Server\udrive\usr\local\php\extensions

libeay32.dll to folder *\Uniform Server\udrive\usr\local\php

ssleay32.dll to folder *\Uniform Server\udrive\usr\local\php

 

Enable extension:

Open php.ini located in folder *\Uniform Server\udrive\usr\local\php

 

Locate the line:

;extension=php_openssl.dll

Change to

extension=php_openssl.dll

 

Save and start the servers with luck your script should work.

 

Note: I believe PHP first looks in it’s own folder to pick up the openssl files hence no need to place them in the system path!

 

Yahoo is not the only one that requires a secure connection the above may also be applicable to these.

 

I do not have this type of account hence that’s as far as I can test.

 

I hope the above is of some help.

 

All the best

Ric :)

ssl_php.exe

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...