OpenSSL error connecting to SMTP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
raheelm
Forum Newbie
Posts: 1
Joined: Thu Aug 17, 2006 10:07 pm

OpenSSL error connecting to SMTP

Post by raheelm »

So I need to connect to an SMTP server using SSL. OpenSSL is able to make the connection fine from the command line:

Code: Select all

openssl s_client -connect smtp.unixx.edu:25 -crlf -starttls smtp
But when I use fsockopen() I get this error:

Code: Select all

Warning: fsockopen() [function.fsockopen]: SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol in /var/www/classes/mail/SMTPMailer.inc.php on line 163

Warning: fsockopen() [function.fsockopen]: Failed to enable crypto in /var/www/classes/mail/SMTPMailer.inc.php on line 163

Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.unixx.edu:25 (Unknown error) in /var/www/classes/mail/SMTPMailer.inc.php on line 163

Warning: Cannot modify header information - headers already sent by (output started at /var/www/classes/mail/SMTPMailer.inc.php:163) in /var/www/classes/core/Request.inc.php on line 33
Any clues ?
Thanks!
Post Reply