This commit is contained in:
Laurent Destailleur 2012-01-04 14:05:49 +01:00
parent 16c6dd3c95
commit 893b7b96f4

View File

@ -240,23 +240,45 @@ class SMTPs
/**
* Set delivery receipt
*
* @param int $_val Value
* @return void
*/
function setDeliveryReceipt($_val = 0)
{
$this->_deliveryReceipt = $_val;
}
/**
* get delivery receipt
*
* @return int Delivery receipt
*/
function getDeliveryReceipt()
{
return $this->_deliveryReceipt;
}
/**
* Set errors to
*
* @param string $_strErrorsTo Errors to
* @return void
*/
function setErrorsTo($_strErrorsTo)
{
if ( $_strErrorsTo )
$this->_errorsTo = $this->_strip_email($_strErrorsTo);
}
/**
* Get errors to
*
* @param boolean $_part Variant
* @return string Errors to
*/
function getErrorsTo($_part = true )
{
$_retValue = '';
@ -269,7 +291,12 @@ class SMTPs
return $_retValue;
}
/**
* Set debug
*
* @param boolean $_vDebug Value for debug
* @return void
*/
function setDebug($_vDebug = false )
{
$this->_debug = $_vDebug;
@ -314,11 +341,13 @@ class SMTPs
else
{
//See if we can connect to the SMTP server
if ( $this->socket = @fsockopen($this->getHost(), // Host to 'hit', IP or domain
if ($this->socket = @fsockopen(
$this->getHost(), // Host to 'hit', IP or domain
$this->getPort(), // which Port number to use
$this->errno, // actual system level error
$this->errstr, // and any text that goes with the error
$this->_smtpTimeout) ) // timeout for reading/writing data over the socket
$this->_smtpTimeout
)) // timeout for reading/writing data over the socket
{
// Fix from PHP SMTP class by 'Chris Ryan'
// Sometimes the SMTP server takes a little longer to respond
@ -1119,7 +1148,8 @@ class SMTPs
/**
* Message Content
*
* @param string $_msgContent Message Content
* @param string $strContent Message Content
* @param string $strType Type
* @return void
*/
function setBodyContent($strContent, $strType = 'plain')
@ -1199,7 +1229,7 @@ class SMTPs
// . "\r\n"
// . 'This is a multi-part message in MIME format.' . "\r\n";
$content .= "Content-Transfer-Encoding: 8bit" . "\r\n";
$content .= "Content-Transfer-Encoding: 8bit\r\n";
$content .= "\r\n";
// Loop through message content array
@ -1219,9 +1249,7 @@ class SMTPs
if ( $this->getMD5flag() )
$content .= 'Content-MD5: ' . $_data['md5'] . "\r\n";
$content .= "\r\n"
. $_data['data'] . "\r\n"
. "\r\n";
$content .= "\r\n" . $_data['data'] . "\r\n\r\n";
}
}
// DOL_CHANGE LDR
@ -1262,9 +1290,7 @@ class SMTPs
if ( $this->getMD5flag() )
$content .= 'Content-MD5: ' . $_content['md5'] . "\r\n";
$content .= "\r\n"
. $_content['data'] . "\r\n"
. "\r\n";
$content .= "\r\n" . $_content['data'] . "\r\n\r\n";
}
}
@ -1355,7 +1381,6 @@ class SMTPs
* - [2] Private
* - [3] Company Confidential
*
* @param string Message Sensitivity
* @return void
*/
function getSensitivity()
@ -1471,8 +1496,9 @@ class SMTPs
* This function has been modified as provided by SirSir to allow multiline responses when
* using SMTP Extensions
*
* @param $socket
* @param $response
* @param Handler $socket Socket handler
* @param string $response Response
* @return boolean True or false
*/
function server_parse($socket, $response)
{
@ -1502,6 +1528,14 @@ class SMTPs
return $_retVal;
}
/**
* Send str
*
* @param string $_strSend String to send
* @param string $_returnCode Return code
* @param string $CRLF CRLF
* @return boolean True or false
*/
function socket_send_str( $_strSend, $_returnCode = null, $CRLF = "\r\n" )
{
if ($this->_debug) $this->log.=$_strSend; // DOL_CHANGE LDR for log