Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -36,7 +36,7 @@ class _PHP extends \IPS\Email
|
||||
*/
|
||||
public function _send( $to, $cc=array(), $bcc=array(), $fromEmail = NULL, $fromName = NULL, $additionalHeaders = array() )
|
||||
{
|
||||
$boundary = "--==_mimepart_" . md5( uniqid() );
|
||||
$boundary = "--==_mimepart_" . md5( mt_rand() );
|
||||
|
||||
$subject = $this->compileSubject( static::_getMemberFromRecipients( $to ) );
|
||||
$headers = array();
|
||||
@@ -53,8 +53,16 @@ class _PHP extends \IPS\Email
|
||||
if ( !mail( $this->_parseRecipients( $to, TRUE ), static::encodeHeader( $subject ), $this->_compileMessage( static::_getMemberFromRecipients( $to ), $boundary, PHP_EOL, 68 ), implode( PHP_EOL, $headers ), \IPS\Settings::i()->php_mail_extra ) )
|
||||
{
|
||||
$error = error_get_last();
|
||||
preg_match( "/^(\d+)/", $error['message'], $matches );
|
||||
throw new \IPS\Email\Outgoing\Exception( $error['message'], isset( $matches[1] ) ? $matches[1] : NULL );
|
||||
if ( $error )
|
||||
{
|
||||
preg_match( "/^(\d+)/", $error['message'], $matches );
|
||||
throw new \IPS\Email\Outgoing\Exception( $error['message'], isset( $matches[1] ) ? $matches[1] : NULL );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If $error is null, mail() is probably disabled */
|
||||
throw new \IPS\Email\Outgoing\Exception( \IPS\Member::loggedIn()->language()->addToStack( 'email_test_mailfunction_disabled', FALSE ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
|
||||
Reference in new issue
Block a user