123 'Company Confidential');
226 private $_errorsTo =
'';
227 private $_deliveryReceipt = 0;
228 private $_trackId =
'';
229 private $_moreInHeader =
'';
255 $this->_deliveryReceipt = $_val;
265 return $this->_deliveryReceipt;
276 $this->_trackId = $_val;
287 $this->_moreinheader = $_val;
297 return $this->_trackId;
307 return $this->_moreinheader;
333 $_retValue = $this->_errorsTo;
334 else $_retValue = $this->_errorsTo[$_part];
347 $this->_debug = $_vDebug;
358 $_aryToList = $this->getTO();
377 $usetls = preg_match(
'@tls://@i', $host);
379 $host = preg_replace(
'@tcp://@i',
'', $host);
380 $host = preg_replace(
'@ssl://@i',
'', $host);
381 $host = preg_replace(
'@tls://@i',
'', $host);
384 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
386 if ((!
is_ip($host)) && ((gethostbyname($host)) == $host))
388 $this->
_setErr(99, $host.
' is either offline or is an invalid host name.');
391 if (function_exists(
'stream_socket_client') && !empty($this->_options)) {
392 $socket_context = stream_context_create($this->_options);
393 set_error_handler([$this,
'errorHandler']);
394 $this->socket = @stream_socket_client(
395 preg_replace(
'@tls://@i',
'', $this->
getHost()).
400 STREAM_CLIENT_CONNECT,
404 $this->socket = @fsockopen(
405 preg_replace(
'@tls://@i',
'', $this->
getHost()),
414 if (is_resource($this->socket))
420 if (function_exists(
'stream_set_timeout')) stream_set_timeout($this->socket, $this->_smtpTimeout, 0);
423 if ($_retVal = $this->
server_parse($this->socket,
"220"))
424 $_retVal = $this->socket;
429 if (empty($this->errstr)) $this->errstr =
'Failed to connect with fsockopen host='.$this->getHost().
' port='.$this->
getPort();
430 $this->
_setErr($this->errno, $this->errstr);
453 $usetls = preg_match(
'@tls://@i', $host);
455 $host = preg_replace(
'@tcp://@i',
'', $host);
456 $host = preg_replace(
'@ssl://@i',
'', $host);
457 $host = preg_replace(
'@tls://@i',
'', $host);
459 if ($usetls && !empty($conf->global->MAIN_SMTPS_ADD_TLS_TO_HOST_FOR_HELO)) $host =
'tls://'.$host;
463 if (!empty($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO))
466 $hosth = $this->
getFrom(
'addr');
467 $hosth = preg_replace(
'/^.*</',
'', $hosth);
468 $hosth = preg_replace(
'/>.*$/',
'', $hosth);
469 $hosth = preg_replace(
'/.*@/',
'', $hosth);
497 $this->
_setErr(131,
'STARTTLS connection is not supported.');
508 $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
509 if (defined(
'STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
510 $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
511 $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
514 if (!stream_socket_enable_crypto($this->socket,
true, $crypto_method))
516 $this->
_setErr(132,
'STARTTLS connection failed.');
523 $this->
_setErr(126,
'"'.$hosth.
'" does not support authenticated connections.');
529 if (empty($conf->global->MAIL_SMTP_AUTH_TYPE)) $conf->global->MAIL_SMTP_AUTH_TYPE =
'LOGIN';
533 switch ($conf->global->MAIL_SMTP_AUTH_TYPE) {
537 $_retVal = $this->
socket_send_str(base64_encode(
"\0".$this->_smtpsID.
"\0".$this->_smtpsPW),
'235');
546 $_retVal = $this->
socket_send_str(base64_encode($this->_smtpsPW),
'235');
550 $this->
_setErr(130,
'Invalid Authentication Credentials.');
553 $this->
_setErr(126,
'"'.$host.
'" does not support authenticated connections.');
577 if (!empty($this->_smtpsID) && !empty($this->_smtpsPW))
587 $usetls = preg_match(
'@tls://@i', $host);
589 $host = preg_replace(
'@tcp://@i',
'', $host);
590 $host = preg_replace(
'@ssl://@i',
'', $host);
591 $host = preg_replace(
'@tls://@i',
'', $host);
593 if ($usetls && !empty($conf->global->MAIN_SMTPS_ADD_TLS_TO_HOST_FOR_HELO)) $host =
'tls://'.$host;
597 if (!empty($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO))
600 $hosth = $this->
getFrom(
'addr');
601 $hosth = preg_replace(
'/^.*</',
'', $hosth);
602 $hosth = preg_replace(
'/>.*$/',
'', $hosth);
603 $hosth = preg_replace(
'/.*@/',
'', $hosth);
616 if (!$resultmailfrom) {
617 fclose($this->socket);
653 fputs($this->socket,
'QUIT');
654 fclose($this->socket);
700 if (!empty($_strConfigPath))
704 if (!@include $_strConfigPath)
706 $this->
_setErr(110,
'"'.$_strConfigPath.
'" is not a valid path.');
715 if ($_host = ini_get(
'SMTPs'))
718 if ($_port = ini_get(
'smtp_port'))
721 if ($_from = ini_get(
'sendmail_from'))
740 if ((is_numeric($_type)) && (($_type >= 0) && ($_type <= 3))) {
741 $this->_transportType = $_type;
784 $this->_smtpsHost = $_strHost;
808 if ((is_numeric($_intPort)) &&
809 (($_intPort >= 1) && ($_intPort <= 65536)))
810 $this->_smtpsPort = $_intPort;
832 $this->_smtpsID = $_strID;
853 $this->_smtpsPW = $_strPW;
876 $this->_smtpsCharSet = $_strCharSet;
906 if (array_search($_strTransEncode, $this->_smtpsTransEncodeTypes))
907 $this->_smtpsTransEncode = $_strTransEncode;
938 if (array_search($_strTransEncodeType, $this->_smtpsTransEncodeTypes))
939 $this->_smtpsTransEncodeType = $_strTransEncodeType;
979 else $_retValue = $this->_msgFrom[$_part];
1006 if ($_part ===
true)
1008 else $_retValue = $this->_msgReplyTo[$_part];
1031 if (!empty($_addrList))
1034 if (is_string($_addrList))
1037 if (strstr($_addrList,
','))
1039 $_addrList = explode(
',', $_addrList);
1042 else $_addrList = array($_addrList);
1046 foreach ($_addrList as $_strAddr)
1049 $_strAddr = str_replace(
'>',
'', $_strAddr);
1053 $_tmpaddr = explode(
'<', $_strAddr);
1056 if (count($_tmpaddr) == 2)
1058 $_tmpHost = explode(
'@', $_tmpaddr[1]);
1059 $_tmpaddr[0] = trim($_tmpaddr[0],
' ">');
1060 $aryHost[$_tmpHost[1]][$_type][$_tmpHost[0]] = $_tmpaddr[0];
1065 $_strAddr = str_replace(
'<',
'', $_strAddr);
1067 $_tmpHost = explode(
'@', $_strAddr);
1068 $_tmpHost[0] = trim($_tmpHost[0]);
1069 $_tmpHost[1] = trim($_tmpHost[1]);
1071 $aryHost[$_tmpHost[1]][$_type][$_tmpHost[0]] =
'';
1076 $this->_msgRecipients = $aryHost;
1100 $_aryEmail[
'org'] = $_strAddr;
1103 $_strAddr = strtolower($_strAddr);
1106 $_strAddr = trim($_strAddr,
' ">');
1109 $_tmpAry = explode(
'<', $_strAddr);
1112 if (count($_tmpAry) == 2)
1116 $_aryEmail[
'real'] = trim($_tmpAry[0],
' ">');
1118 $_aryEmail[
'addr'] = $_tmpAry[1];
1119 }
else $_aryEmail[
'addr'] = $_tmpAry[0];
1122 list($_aryEmail[
'user'], $_aryEmail[
'host']) = explode(
'@', $_aryEmail[
'addr']);
1125 $_aryEmail[
'addr'] =
'<'.$_aryEmail[
'addr'].
'>';
1144 $_RCPT_list = array();
1147 foreach ($this->_msgRecipients as $_host => $_list)
1149 foreach ($_list as $_subList)
1151 foreach ($_subList as $_name => $_addr)
1154 $_RCPT_list[] = $_name.
'@'.$_host;
1176 if ($this->_msgRecipients)
1178 $_RCPT_list = array();
1180 foreach ($this->_msgRecipients as $_host => $_list)
1182 if ($this->_msgRecipients[$_host][$_which])
1184 foreach ($this->_msgRecipients[$_host][$_which] as $_addr => $_realName)
1188 $_realName =
'"'.$_realName.
'"';
1189 $_RCPT_list[] = $_realName.
' <'.$_addr.
'@'.$_host.
'>';
1191 $_RCPT_list[] = $_addr.
'@'.$_host;
1197 return implode(
', ', $_RCPT_list);
1199 $this->
_setErr(101,
'No eMail Address for message to be sent to.');
1203 $this->
_setErr(102,
'eMail type not defined.');
1283 $this->_msgSubject = $_strSubject;
1305 $_header =
'From: '.$this->getFrom(
'org').
"\r\n"
1306 .
'To: '.$this->getTO().
"\r\n";
1309 $_header .=
'Cc: '.$this->getCC().
"\r\n";
1322 $host = dol_getprefix(
'email');
1325 $_header .=
'Subject: '.$this->getSubject().
"\r\n";
1326 $_header .=
'Date: '.date(
"r").
"\r\n";
1332 $_header .=
'Message-ID: <'.time().
'.SMTPs-dolibarr-'.$trackid.
'@'.$host.
">\r\n";
1333 $_header .=
'References: <'.time().
'.SMTPs-dolibarr-'.$trackid.
'@'.$host.
">\r\n";
1334 $_header .=
'X-Dolibarr-TRACKID: '.$trackid.
'@'.$host.
"\r\n";
1336 $_header .=
'Message-ID: <'.time().
'.SMTPs@'.$host.
">\r\n";
1338 if (!empty(
$_SERVER[
'REMOTE_ADDR'])) $_header .=
"X-RemoteAddr: ".$_SERVER[
'REMOTE_ADDR'].
"\r\n";
1347 $_header .=
'Sensitivity: '.$this->getSensitivity().
"\r\n";
1349 if ($this->_msgPriority != 3)
1355 $_header .=
'Disposition-Notification-To: '.$this->getFrom(
'addr').
"\r\n";
1357 $_header .=
'Errors-To: '.$this->getErrorsTo(
'addr').
"\r\n";
1359 $_header .=
"Reply-To: ".$this->getReplyTo(
'addr').
"\r\n";
1361 $_header .=
'X-Mailer: Dolibarr version '.DOL_VERSION.
' (using SMTPs Mailer)'.
"\r\n";
1362 $_header .=
'X-Dolibarr-Option: '.($conf->global->MAIN_MAIL_USE_MULTI_PART ?
'MAIN_MAIL_USE_MULTI_PART' :
'No MAIN_MAIL_USE_MULTI_PART').
"\r\n";
1363 $_header .=
'Mime-Version: 1.0'.
"\r\n";
1380 if ($strType ==
'html')
1381 $strMimeType =
'text/html';
1382 else $strMimeType =
'text/plain';
1385 $strContent = preg_replace(
"/(?<!\r)\n/si",
"\r\n", $strContent);
1387 $strContentAltText =
'';
1388 if ($strType ==
'html')
1391 $strContentAltText = preg_replace(
'/<head><title>.*<\/style><\/head>/',
'', $strContent);
1392 $strContentAltText = preg_replace(
"/<br\s*[^>]*>/",
" ", $strContentAltText);
1393 $strContentAltText = html_entity_decode(strip_tags($strContentAltText));
1394 $strContentAltText = trim(wordwrap($strContentAltText, 75,
"\r\n"));
1399 $strContent = rtrim(wordwrap($strContent, 75,
"\r\n"));
1401 $this->_msgContent[$strType] = array();
1403 $this->_msgContent[$strType][
'mimeType'] = $strMimeType;
1404 $this->_msgContent[$strType][
'data'] = $strContent;
1405 $this->_msgContent[$strType][
'dataText'] = $strContentAltText;
1408 $this->_msgContent[$strType][
'md5'] =
dol_hash($strContent, 3);
1425 $_types = array_keys($this->_msgContent);
1428 $keyCount = count($_types);
1431 if ($keyCount === 0)
1432 die(
"Sorry, no content");
1435 elseif ($keyCount === 1 && empty($conf->global->MAIN_MAIL_USE_MULTI_PART))
1438 $_msgData = $_msgData[$_types[0]];
1440 $content =
'Content-Type: '.$_msgData[
'mimeType'].
'; charset="'.$this->
getCharSet().
'"'.
"\r\n"
1441 .
'Content-Transfer-Encoding: '.$this->getTransEncodeType().
"\r\n"
1442 .
'Content-Disposition: inline'.
"\r\n"
1443 .
'Content-Description: Message'.
"\r\n";
1446 $content .=
'Content-MD5: '.$_msgData[
'md5'].
"\r\n";
1449 . $_msgData[
'data'].
"\r\n";
1453 elseif ($keyCount >= 1 || !empty($conf->global->MAIN_MAIL_USE_MULTI_PART))
1460 $content =
'Content-Type: multipart/mixed; boundary="'.$this->_getBoundary(
'mixed').
'"'.
"\r\n";
1464 $content .=
"Content-Transfer-Encoding: 8bit\r\n";
1467 $content .=
"--".$this->_getBoundary(
'mixed').
"\r\n";
1469 if (key_exists(
'image', $this->_msgContent))
1471 $content .=
'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary(
'alternative').
'"'.
"\r\n";
1473 $content .=
"--".$this->_getBoundary(
'alternative').
"\r\n";
1481 foreach ($this->_msgContent as $type => $_content)
1483 if ($type ==
'attachment')
1486 foreach ($_content as $_file => $_data)
1488 $content .=
"--".$this->_getBoundary(
'mixed').
"\r\n"
1489 .
'Content-Disposition: attachment; filename="'.$_data[
'fileName'].
'"'.
"\r\n"
1490 .
'Content-Type: '.$_data[
'mimeType'].
'; name="'.$_data[
'fileName'].
'"'.
"\r\n"
1491 .
'Content-Transfer-Encoding: base64'.
"\r\n"
1492 .
'Content-Description: '.$_data[
'fileName'].
"\r\n";
1495 $content .=
'Content-MD5: '.$_data[
'md5'].
"\r\n";
1497 $content .=
"\r\n".$_data[
'data'].
"\r\n\r\n";
1501 elseif ($type ==
'image')
1504 foreach ($_content as $_image => $_data)
1506 $content .=
"--".$this->_getBoundary(
'related').
"\r\n";
1508 $content .=
'Content-Type: '.$_data[
'mimeType'].
'; name="'.$_data[
'imageName'].
'"'.
"\r\n"
1509 .
'Content-Transfer-Encoding: base64'.
"\r\n"
1510 .
'Content-Disposition: inline; filename="'.$_data[
'imageName'].
'"'.
"\r\n"
1511 .
'Content-ID: <'.$_data[
'cid'].
'> '.
"\r\n";
1514 $content .=
'Content-MD5: '.$_data[
'md5'].
"\r\n";
1517 . $_data[
'data'].
"\r\n";
1521 $content .=
"--".$this->_getBoundary(
'related').
"--\r\n";
1522 $content .=
"\r\n--".$this->_getBoundary(
'alternative').
"--\r\n";
1525 if (key_exists(
'image', $this->_msgContent))
1527 $content .=
"Content-Type: text/plain; charset=".$this->getCharSet().
"\r\n";
1528 $content .=
"\r\n".($_content[
'dataText'] ? $_content[
'dataText'] : strip_tags($_content[
'data'])).
"\r\n";
1529 $content .=
"--".$this->_getBoundary(
'alternative').
"\r\n";
1530 $content .=
'Content-Type: multipart/related; boundary="'.$this->_getBoundary(
'related').
'"'.
"\r\n";
1532 $content .=
"--".$this->_getBoundary(
'related').
"\r\n";
1535 if (!key_exists(
'image', $this->_msgContent) && $_content[
'dataText'] && !empty($conf->global->MAIN_MAIL_USE_MULTI_PART))
1537 $content .=
'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary(
'alternative').
'"'.
"\r\n";
1539 $content .=
"--".$this->_getBoundary(
'alternative').
"\r\n";
1541 $content .=
"Content-Type: text/plain; charset=".$this->getCharSet().
"\r\n";
1542 $content .=
"\r\n".$_content[
'dataText'].
"\r\n";
1543 $content .=
"--".$this->_getBoundary(
'alternative').
"\r\n";
1546 $content .=
'Content-Type: '.$_content[
'mimeType'].
'; charset='.$this->
getCharSet();
1551 $content .=
'Content-MD5: '.$_content[
'md5'].
"\r\n";
1554 $content .=
"\r\n".$_content[
'data'].
"\r\n";
1556 if (!key_exists(
'image', $this->_msgContent) && $_content[
'dataText'] && !empty($conf->global->MAIN_MAIL_USE_MULTI_PART))
1558 $content .=
"--".$this->_getBoundary(
'alternative').
"--\r\n";
1565 $content .=
"--".$this->_getBoundary(
'mixed').
'--'.
"\r\n";
1580 public function setAttachment($strContent, $strFileName =
'unknown', $strMimeType =
'unknown')
1584 $strContent = rtrim(chunk_split(base64_encode($strContent), 76,
"\r\n"));
1586 $this->_msgContent[
'attachment'][$strFileName][
'mimeType'] = $strMimeType;
1587 $this->_msgContent[
'attachment'][$strFileName][
'fileName'] = $strFileName;
1588 $this->_msgContent[
'attachment'][$strFileName][
'data'] = $strContent;
1591 $this->_msgContent[
'attachment'][$strFileName][
'md5'] =
dol_hash($strContent, 3);
1608 public function setImageInline($strContent, $strImageName =
'unknown', $strMimeType =
'unknown', $strImageCid =
'unknown')
1612 $this->_msgContent[
'image'][$strImageName][
'mimeType'] = $strMimeType;
1613 $this->_msgContent[
'image'][$strImageName][
'imageName'] = $strImageName;
1614 $this->_msgContent[
'image'][$strImageName][
'cid'] = $strImageCid;
1615 $this->_msgContent[
'image'][$strImageName][
'data'] = $strContent;
1618 $this->_msgContent[
'image'][$strImageName][
'md5'] =
dol_hash($strContent, 3);
1637 if ((is_numeric($_value)) &&
1638 (($_value >= 0) && ($_value <= 3)))
1639 $this->_msgSensitivity = $_value;
1672 if ((is_numeric($_value)) &&
1673 (($_value >= 0) && ($_value <= 5)))
1674 $this->_msgPriority = $_value;
1693 .
'X-Priority: '.$this->_msgPriority.
' ('.$this->_aryPriority[
$this->_msgPriority].
')'.
"\r\n";
1704 $this->_smtpMD5 = $_flag;
1728 $this->_msgXheader[] = $strXdata;
1748 $this->_smtpsBoundary =
"multipart_x.".time().
".x_boundary";
1749 $this->_smtpsRelatedBoundary =
'mul_'.dol_hash(uniqid(
"dolibarr2"), 3);
1750 $this->_smtpsAlternativeBoundary =
'mul_'.dol_hash(uniqid(
"dolibarr3"), 3);
1784 $server_response =
'';
1789 while (substr($server_response, 3, 1) !=
' ' && $limit < 100)
1791 if (!($server_response = fgets($socket, 256)))
1793 $this->
_setErr(121,
"Couldn't get mail server response codes");
1797 $this->log .= $server_response;
1801 if (!(substr($server_response, 0, 3) == $response))
1803 $this->
_setErr(120,
"Ran into problems sending Mail.\r\nResponse: $server_response");
1822 if ($this->_debug) $this->log .= $_strSend;
1823 fputs($this->socket, $_strSend.$CRLF);
1824 if ($this->_debug) $this->log .=
' ('.$_returnCode.
')'.$CRLF;
1827 return $this->
server_parse($this->socket, $_returnCode);
1842 $this->_smtpsErrors[] = array(
1857 if (is_array($this->_smtpsErrors))
1859 foreach ($this->_smtpsErrors as $_err => $_info)
1861 $_errMsg[] =
'Error ['.$_info[
'num'].
']: '.$_info[
'msg'];
1865 return implode(
"\n", $_errMsg);
setDebug($_vDebug=false)
Set debug.
getID()
Retrieves the User Name for authentication on Mail Server.
$_debug
Place Class in" debug" mode.
$_smtpsPW
Secure SMTP Server access Password This can be defined via a INI file or via a setter method...
$_transportType
Determines the method inwhich the message are to be sent.
getTransportType()
Return the method inwhich the message is to be sent.
dol_hash($chain, $type= '0')
Returns a hash of a string.
getPW()
Retrieves the User Password for authentication on Mail Server.
setSensitivity($_value=0)
Message Content Sensitivity Message Sensitivity values:
getTransEncodeType()
Retrieves the Content-Transfer-Encoding.
setBodyContent($strContent, $strType= 'plain')
Message Content.
setTransEncodeType($_strTransEncodeType)
Content-Transfer-Encoding, Defaulted to '0' [ZERO] This can be changed for 2byte characers sets Known...
setCharSet($_strCharSet)
Character set used for current message Character set is defaulted to 'iso-8859-1';.
$_msgFrom
Who sent the Message This can be defined via a INI file or via a setter method.
setFrom($_strFrom)
FROM Address from which mail will be sent.
$_msgRecipients
Who will the Message be sent to; TO, CC, BCC Multi-diminsional array containg addresses the message w...
getSensitivity()
Returns Message Content Sensitivity string Message Sensitivity values:
$_smtpsID
Secure SMTP Server access ID This can be defined via a INI file or via a setter method.
getCharSet()
Retrieves the Character set used for current message.
buildRCPTlist()
build RECIPIENT List, all addresses who will recieve this message
Class to construct and send SMTP compliant email, even to a secure SMTP server, regardless of platfor...
setMoreInHeader($_val= '')
Set moreInHeader.
setXheader($strXdata)
Message X-Header Content This is a simple "insert".
getFrom($_part=true)
Retrieves the Address from which mail will be sent.
_server_authenticate()
Attempt mail server authentication for a secure connection.
getHeader()
Constructes and returns message header.
setTrackId($_val= '')
Set trackid.
$_msgXheader
Custom X-Headers.
$_smtpTimeout
Sets the SMTP server timeout in seconds.
$_msgContent
Message Content.
setBCC($_strBCC)
BCC Address[es] inwhich to send mail to.
$_smtpMD5
Determines whether to calculate message MD5 checksum.
get_email_list($_which=null)
Returns an array of addresses for a specific type; TO, CC or BCC.
$_smtpsTransEncodeTypes
Content-Transfer-Encoding.
getMoreInHeader()
get moreInHeader
getMD5flag()
Gets flag which determines whether to calculate message MD5 checksum.
setTransEncode($_strTransEncode)
Content-Transfer-Encoding, Defaulted to '7bit' This can be changed for 2byte characers sets Known Enc...
getBodyContent()
Retrieves the Message Content.
get_RCPT_list()
Returns an array of bares addresses for use with 'RCPT TO:' This is a "build as you go" method...
setHost($_strHost)
Defines the Host Name or IP of the Mail Server to use.
getTo()
Retrieves the TO Address[es] inwhich to send mail to.
setErrorsTo($_strErrorsTo)
Set errors to.
_buildAddrList($_type, $_addrList)
Inserts given addresses into structured format.
$_arySensitivity
Message Sensitivity.
$_log_level
Defines log level 0 - no logging 1 - connectivity logging 2 - message generation logging 3 - detail l...
setCC($_strCC)
CC Address[es] inwhich to send mail to.
$_options
An array of options for stream_context_create()
_server_connect()
Attempt a connection to mail server.
$_msgReplyTo
Where are replies and errors to be sent to This can be defined via a INI file or via a setter method...
setImageInline($strContent, $strImageName= 'unknown', $strMimeType= 'unknown', $strImageCid= 'unknown')
Image attachments are added to the content array as sub-arrays, allowing for multiple images for each...
setPort($_intPort)
Defines the Port Number of the Mail Server to use This is defaulted to '25' This is used only with 's...
getBCC()
Retrieves the BCC Address[es] inwhich to send mail to.
$_smtpsHost
Host Name or IP of SMTP Server to use.
$_smtpsAlternativeBoundary
Alternative Boundary.
socket_send_str($_strSend, $_returnCode=null, $CRLF="\r\n")
Send str.
$_smtpsTransEncode
Content-Transfer-Encoding Defaulted to '7bit'.
setOptions($_options=[])
Set delivery receipt.
setAttachment($strContent, $strFileName= 'unknown', $strMimeType= 'unknown')
File attachments are added to the content array as sub-arrays, allowing for multiple attachments for ...
setReplyTo($_strReplyTo)
Reply-To Address from which mail will be the reply-to.
server_parse($socket, $response)
This function has been modified as provided by SirSir to allow multiline responses when using SMTP Ex...
getErrors()
Returns errors codes and messages for Class.
getPort()
Retrieves the Port Number of the Mail Server to use This is used only with 'socket' based mail transm...
setTO($_addrTo)
TO Address[es] inwhich to send mail to.
is_ip($ip)
This function evaluates a string that should be a valid IPv4 Note: For ip 169.254.0.0, it returns 0 with some PHP (5.6.24) and 2 with some minor patchs of PHP (5.6.25).
$_smtpsRelatedBoundary
Related Boundary.
setTransportType($_type=0)
Determines the method inwhich the messages are to be sent.
getHost()
Retrieves the Host Name or IP of the Mail Server to use This is used only with 'socket' based mail tr...
getXheader()
Retrieves the Message X-Header Content.
$_aryPriority
Message Priority.
print $_SERVER["PHP_SELF"]
Edit parameters.
getPriority()
Message Content Priority Message Priority values:
getCC()
Retrieves the CC Address[es] inwhich to send mail to.
$_smtpsTransEncodeType
Content-Transfer-Encoding Defaulted to 0 - 7bit.
getSubject()
Retrieves the Message Subject.
$_msgSensitivity
Message Sensitivity Defaults to ZERO - None.
getDeliveryReceipt()
get delivery receipt
_strip_email($_strAddr)
Returns an array of the various parts of an email address This assumes a well formed address: ...
sendMsg()
Now send the message.
$_smtpsCharSet
Character set Defaulted to 'iso-8859-1'.
$_smtpsErrors
Class error codes and messages.
getErrorsTo($_part=true)
Get errors to.
getReplyTo($_part=true)
Retrieves the Address from which mail will be the reply-to.
setPW($_strPW)
User Password for authentication on Mail Server.
setSubject($_strSubject= '')
Message Subject.
$_mailPath
If '$_transportType' is set to '1', then this variable is used to define the UNIX file system path to...
setConfig($_strConfigPath=null)
setConfig() is used to populate select class properties from either a user defined INI file or the sy...
$_msgSubject
Message Subject.
$_msgPriority
Message Sensitivity Defaults to 3 - Normal.
setDeliveryReceipt($_val=0)
Set delivery receipt.
$_smtpsBoundary
Boundary String for MIME seperation.
_getBoundary($type= 'mixed')
Retrieves the MIME message Boundary.
_setBoundary()
Generates Random string for MIME message Boundary.
getTransEncode()
Retrieves the Content-Transfer-Encoding.
setMailPath($_path)
Path to the sendmail execuable.
$_smtpsPort
SMTP Server Port definition.
setID($_strID)
User Name for authentication on Mail Server.
_setErr($_errNum, $_errMsg)
Defines errors codes and messages for Class.
setPriority($_value=3)
Message Content Priority Message Priority values:
setMD5flag($_flag=false)
Set flag which determines whether to calculate message MD5 checksum.