Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -11,7 +11,7 @@
|
||||
namespace IPS\Email\Outgoing;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -65,6 +65,11 @@ class _SMTP extends \IPS\Email
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $smtpProtocol Protocol to use
|
||||
* @param string $smtpHost Hostname to connect to
|
||||
* @param int $smtpPort Port to connect to
|
||||
* @param string $smtpUser Username
|
||||
* @param string $smtpPass Password
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( $smtpProtocol, $smtpHost, $smtpPort, $smtpUser, $smtpPass )
|
||||
@@ -133,7 +138,7 @@ class _SMTP extends \IPS\Email
|
||||
}
|
||||
|
||||
$this->_sendCommand( 'STARTTLS', 220 );
|
||||
if ( !@\stream_socket_enable_crypto( static::$smtp[ $this->connectionKey ], TRUE, version_compare( PHP_VERSION, '5.6.7' ) >= 0 ? STREAM_CRYPTO_METHOD_SSLv23_CLIENT : STREAM_CRYPTO_METHOD_TLS_CLIENT ) )
|
||||
if ( !@\stream_socket_enable_crypto( static::$smtp[ $this->connectionKey ], TRUE, STREAM_CRYPTO_METHOD_SSLv23_CLIENT ) )
|
||||
{
|
||||
if ( $checkSsl )
|
||||
{
|
||||
@@ -199,7 +204,6 @@ class _SMTP extends \IPS\Email
|
||||
* @param string $fromEmail The email address to send from
|
||||
* @param array $toEmails Array of email addresses to send to
|
||||
* @param string $email The full email (with headers, etc.) except the Bcc header
|
||||
* @param array $additionalHeaders Additional headers to send
|
||||
* @return void
|
||||
* @throws \IPS\Email\Outgoing\Exception
|
||||
*/
|
||||
@@ -239,7 +243,7 @@ class _SMTP extends \IPS\Email
|
||||
$response = $this->_getResponse();
|
||||
|
||||
/* Get response code */
|
||||
$code = intval( mb_substr( $response, 0, 3 ) );
|
||||
$code = \intval( mb_substr( $response, 0, 3 ) );
|
||||
if ( $expectedResponse !== NULL and $code !== $expectedResponse )
|
||||
{
|
||||
if( $resetOnFailure === TRUE )
|
||||
@@ -273,7 +277,7 @@ class _SMTP extends \IPS\Email
|
||||
}
|
||||
|
||||
/* Log */
|
||||
$this->log .= $response;
|
||||
$this->log .= mb_convert_encoding( $response, 'UTF-8', 'ASCII' );
|
||||
|
||||
/* Return */
|
||||
return $response;
|
||||
|
||||
Reference in new issue
Block a user