smtp class SMTP4PHP.php --HELP needed-- (sourceforge.php SMTP4PHP.php-2011-release.zip)
Throws following error, which I don’t understand – can someone help me with its iterpretation? :
Fatal error: Uncaught exception ‘ErrorException’ with message ‘stream_socket_client() [function.stream-socket-client]: SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol’ in /home/vg011web00/68/65/2926568/web/auxlib/usit2013/SMTP4PHP.php:722 Stack trace: #0 [internal function]: exception_error_handler(2, ‘stream_socket_c…’, ‘/home/vg011web0…’, 722, Array) #1 /home/vg011web00/68/65/2926568/web/auxlib/usit2013/SMTP4PHP.php(722): stream_socket_client(‘ssl://smtp.u-si…’, 0, ‘’, 30, 5) #2 /home/vg011web00/68/65/2926568/web/auxlib/usit2013/SMTP4PHP.php(751): SMTP4PHP\SMTP->_connect() #3 /home/vg011web00/68/65/2926568/web/auxlib/usit2013/usage-exmpl-2.php(84): SMTP4PHP\SMTP->send(Object(SMTP4PHP\eMail)) #4 {main} thrown in /home/vg011web00/68/65/2926568/web/auxlib/usit2013/SMTP4PHP.php on line 722
------------------------ my test script (came with SMTP4PHP.php) ----------------------------------------------------
[php]
require_once($_SERVER[‘DOCUMENT_ROOT’].’/auxlib/usit2013/SMTP4PHP.php’);
define(‘DISPLAY_ERRORS’, true);
define(‘DISPLAY_EXCEPTIONS’, true);
set_time_limit(0);
ini_set(‘memory_limit’,-1);
ini_set(‘max_execution_time’,0);
ini_set(‘ignore_user_abort’,‘On’);
ini_set(‘display_errors’, (DISPLAY_ERRORS)?(1):(0));
ini_set(‘display_startup_errors’, (DISPLAY_ERRORS)?(1):(0));
error_reporting((DISPLAY_ERRORS)?(1):(0));
ignore_user_abort (true);
date_default_timezone_set(‘America/New_York’);
// Copyright © 2011 - 2012, Raul IONESCU [email protected],Bucharest, ROMANIA
/*
GMail - TLS encryption example
define(‘SMTP_SERVER’,‘tls://smtp.gmail.com’);
define(‘SMTP_SERVER_PORT’,587);
GMail - SSL encryption example
define(‘SMTP_SERVER’,‘ssl://smtp.gmail.com’);
define(‘SMTP_SERVER_PORT’,465);
Yahoo Mail - SSL encryption example
define(‘SMTP_SERVER’,‘ssl://smtp.mail.yahoo.com’);
define(‘SMTP_SERVER_PORT’,465);
Windows Live.com - TLS encryption example
define(‘SMTP_SERVER’,‘tls://smtp.live.com’);
define(‘SMTP_SERVER_PORT’,587);
/
define(‘SMTP_SERVER’,‘ssl://smtp.u-sit.net’);
define(‘SMTP_SERVER_PORT’, 587); //25 or 587
define(‘SMTP_USER’,‘[email protected]’);
define(‘SMTP_PASSWORD’,‘xxxxx’);
define(‘FROM_NAME’,‘usit’);
define(‘FROM_EMAIL’,‘[email protected]’);
use SMTP4PHP\User;
/
//NOTE: Only if backward compatibility is really needed.
//use SMTP4PHP\eMailUser;
*/
use SMTP4PHP\eMailUser;
use SMTP4PHP\eMail;
use SMTP4PHP\SMTP;
$e = new eMail();
$e->from = new User(FROM_NAME, FROM_EMAIL);
$e->to = new User(FROM_NAME, FROM_EMAIL);
$e->subject = ‘SMTP4PHP Test mail’;
// EXAMPLE: add inline image example
$e->htmlMessage = ‘This is a HTML message!
’;
echo 'L.80
'; ’ : 'Mail failed! ';
$e->txtMessage = ‘This is a TEXT message from usage-exmpl-2.php!’;
// EXAMPLE: add attachment example
$e->addAttachment(‘Attachment.zip’);
$smtp = new SMTP(SMTP_SERVER, SMTP_SERVER_PORT, SMTP_USER, SMTP_PASSWORD);
/* NOTE: ALL emails are sent through the same connection, speeding up transmission. /
echo $smtp->send($e) ? 'Mail sent!
try {
$smtp->send($e);
} //
catch(Exception $e) { }
var_dump($smtp->SMTPlog);
[/php]