Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../PHPMaile...
File: SMTP.php
}
[1000] Fix | Delete
return $this->sendCommand('XCLIENT', 'XCLIENT' . $xclient_options, 250);
[1001] Fix | Delete
}
[1002] Fix | Delete
[1003] Fix | Delete
/**
[1004] Fix | Delete
* Send an SMTP RSET command.
[1005] Fix | Delete
* Abort any transaction that is currently in progress.
[1006] Fix | Delete
* Implements RFC 821: RSET <CRLF>.
[1007] Fix | Delete
*
[1008] Fix | Delete
* @return bool True on success
[1009] Fix | Delete
*/
[1010] Fix | Delete
public function reset()
[1011] Fix | Delete
{
[1012] Fix | Delete
return $this->sendCommand('RSET', 'RSET', 250);
[1013] Fix | Delete
}
[1014] Fix | Delete
[1015] Fix | Delete
/**
[1016] Fix | Delete
* Send a command to an SMTP server and check its return code.
[1017] Fix | Delete
*
[1018] Fix | Delete
* @param string $command The command name - not sent to the server
[1019] Fix | Delete
* @param string $commandstring The actual command to send
[1020] Fix | Delete
* @param int|array $expect One or more expected integer success codes
[1021] Fix | Delete
*
[1022] Fix | Delete
* @return bool True on success
[1023] Fix | Delete
*/
[1024] Fix | Delete
protected function sendCommand($command, $commandstring, $expect)
[1025] Fix | Delete
{
[1026] Fix | Delete
if (!$this->connected()) {
[1027] Fix | Delete
$this->setError("Called $command without being connected");
[1028] Fix | Delete
[1029] Fix | Delete
return false;
[1030] Fix | Delete
}
[1031] Fix | Delete
//Reject line breaks in all commands
[1032] Fix | Delete
if ((strpos($commandstring, "\n") !== false) || (strpos($commandstring, "\r") !== false)) {
[1033] Fix | Delete
$this->setError("Command '$command' contained line breaks");
[1034] Fix | Delete
[1035] Fix | Delete
return false;
[1036] Fix | Delete
}
[1037] Fix | Delete
$this->client_send($commandstring . static::LE, $command);
[1038] Fix | Delete
[1039] Fix | Delete
$this->last_reply = $this->get_lines();
[1040] Fix | Delete
//Fetch SMTP code and possible error code explanation
[1041] Fix | Delete
$matches = [];
[1042] Fix | Delete
if (preg_match('/^([\d]{3})[ -](?:([\d]\\.[\d]\\.[\d]{1,2}) )?/', $this->last_reply, $matches)) {
[1043] Fix | Delete
$code = (int) $matches[1];
[1044] Fix | Delete
$code_ex = (count($matches) > 2 ? $matches[2] : null);
[1045] Fix | Delete
//Cut off error code from each response line
[1046] Fix | Delete
$detail = preg_replace(
[1047] Fix | Delete
"/{$code}[ -]" .
[1048] Fix | Delete
($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . '/m',
[1049] Fix | Delete
'',
[1050] Fix | Delete
$this->last_reply
[1051] Fix | Delete
);
[1052] Fix | Delete
} else {
[1053] Fix | Delete
//Fall back to simple parsing if regex fails
[1054] Fix | Delete
$code = (int) substr($this->last_reply, 0, 3);
[1055] Fix | Delete
$code_ex = null;
[1056] Fix | Delete
$detail = substr($this->last_reply, 4);
[1057] Fix | Delete
}
[1058] Fix | Delete
[1059] Fix | Delete
$this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
[1060] Fix | Delete
[1061] Fix | Delete
if (!in_array($code, (array) $expect, true)) {
[1062] Fix | Delete
$this->setError(
[1063] Fix | Delete
"$command command failed",
[1064] Fix | Delete
$detail,
[1065] Fix | Delete
$code,
[1066] Fix | Delete
$code_ex
[1067] Fix | Delete
);
[1068] Fix | Delete
$this->edebug(
[1069] Fix | Delete
'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply,
[1070] Fix | Delete
self::DEBUG_CLIENT
[1071] Fix | Delete
);
[1072] Fix | Delete
[1073] Fix | Delete
return false;
[1074] Fix | Delete
}
[1075] Fix | Delete
[1076] Fix | Delete
//Don't clear the error store when using keepalive
[1077] Fix | Delete
if ($command !== 'RSET') {
[1078] Fix | Delete
$this->setError('');
[1079] Fix | Delete
}
[1080] Fix | Delete
[1081] Fix | Delete
return true;
[1082] Fix | Delete
}
[1083] Fix | Delete
[1084] Fix | Delete
/**
[1085] Fix | Delete
* Send an SMTP SAML command.
[1086] Fix | Delete
* Starts a mail transaction from the email address specified in $from.
[1087] Fix | Delete
* Returns true if successful or false otherwise. If True
[1088] Fix | Delete
* the mail transaction is started and then one or more recipient
[1089] Fix | Delete
* commands may be called followed by a data command. This command
[1090] Fix | Delete
* will send the message to the users terminal if they are logged
[1091] Fix | Delete
* in and send them an email.
[1092] Fix | Delete
* Implements RFC 821: SAML <SP> FROM:<reverse-path> <CRLF>.
[1093] Fix | Delete
*
[1094] Fix | Delete
* @param string $from The address the message is from
[1095] Fix | Delete
*
[1096] Fix | Delete
* @return bool
[1097] Fix | Delete
*/
[1098] Fix | Delete
public function sendAndMail($from)
[1099] Fix | Delete
{
[1100] Fix | Delete
return $this->sendCommand('SAML', "SAML FROM:$from", 250);
[1101] Fix | Delete
}
[1102] Fix | Delete
[1103] Fix | Delete
/**
[1104] Fix | Delete
* Send an SMTP VRFY command.
[1105] Fix | Delete
*
[1106] Fix | Delete
* @param string $name The name to verify
[1107] Fix | Delete
*
[1108] Fix | Delete
* @return bool
[1109] Fix | Delete
*/
[1110] Fix | Delete
public function verify($name)
[1111] Fix | Delete
{
[1112] Fix | Delete
return $this->sendCommand('VRFY', "VRFY $name", [250, 251]);
[1113] Fix | Delete
}
[1114] Fix | Delete
[1115] Fix | Delete
/**
[1116] Fix | Delete
* Send an SMTP NOOP command.
[1117] Fix | Delete
* Used to keep keep-alives alive, doesn't actually do anything.
[1118] Fix | Delete
*
[1119] Fix | Delete
* @return bool
[1120] Fix | Delete
*/
[1121] Fix | Delete
public function noop()
[1122] Fix | Delete
{
[1123] Fix | Delete
return $this->sendCommand('NOOP', 'NOOP', 250);
[1124] Fix | Delete
}
[1125] Fix | Delete
[1126] Fix | Delete
/**
[1127] Fix | Delete
* Send an SMTP TURN command.
[1128] Fix | Delete
* This is an optional command for SMTP that this class does not support.
[1129] Fix | Delete
* This method is here to make the RFC821 Definition complete for this class
[1130] Fix | Delete
* and _may_ be implemented in future.
[1131] Fix | Delete
* Implements from RFC 821: TURN <CRLF>.
[1132] Fix | Delete
*
[1133] Fix | Delete
* @return bool
[1134] Fix | Delete
*/
[1135] Fix | Delete
public function turn()
[1136] Fix | Delete
{
[1137] Fix | Delete
$this->setError('The SMTP TURN command is not implemented');
[1138] Fix | Delete
$this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);
[1139] Fix | Delete
[1140] Fix | Delete
return false;
[1141] Fix | Delete
}
[1142] Fix | Delete
[1143] Fix | Delete
/**
[1144] Fix | Delete
* Send raw data to the server.
[1145] Fix | Delete
*
[1146] Fix | Delete
* @param string $data The data to send
[1147] Fix | Delete
* @param string $command Optionally, the command this is part of, used only for controlling debug output
[1148] Fix | Delete
*
[1149] Fix | Delete
* @return int|bool The number of bytes sent to the server or false on error
[1150] Fix | Delete
*/
[1151] Fix | Delete
public function client_send($data, $command = '')
[1152] Fix | Delete
{
[1153] Fix | Delete
//If SMTP transcripts are left enabled, or debug output is posted online
[1154] Fix | Delete
//it can leak credentials, so hide credentials in all but lowest level
[1155] Fix | Delete
if (
[1156] Fix | Delete
self::DEBUG_LOWLEVEL > $this->do_debug &&
[1157] Fix | Delete
in_array($command, ['User & Password', 'Username', 'Password'], true)
[1158] Fix | Delete
) {
[1159] Fix | Delete
$this->edebug('CLIENT -> SERVER: [credentials hidden]', self::DEBUG_CLIENT);
[1160] Fix | Delete
} else {
[1161] Fix | Delete
$this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT);
[1162] Fix | Delete
}
[1163] Fix | Delete
set_error_handler([$this, 'errorHandler']);
[1164] Fix | Delete
$result = fwrite($this->smtp_conn, $data);
[1165] Fix | Delete
restore_error_handler();
[1166] Fix | Delete
[1167] Fix | Delete
return $result;
[1168] Fix | Delete
}
[1169] Fix | Delete
[1170] Fix | Delete
/**
[1171] Fix | Delete
* Get the latest error.
[1172] Fix | Delete
*
[1173] Fix | Delete
* @return array
[1174] Fix | Delete
*/
[1175] Fix | Delete
public function getError()
[1176] Fix | Delete
{
[1177] Fix | Delete
return $this->error;
[1178] Fix | Delete
}
[1179] Fix | Delete
[1180] Fix | Delete
/**
[1181] Fix | Delete
* Get SMTP extensions available on the server.
[1182] Fix | Delete
*
[1183] Fix | Delete
* @return array|null
[1184] Fix | Delete
*/
[1185] Fix | Delete
public function getServerExtList()
[1186] Fix | Delete
{
[1187] Fix | Delete
return $this->server_caps;
[1188] Fix | Delete
}
[1189] Fix | Delete
[1190] Fix | Delete
/**
[1191] Fix | Delete
* Get metadata about the SMTP server from its HELO/EHLO response.
[1192] Fix | Delete
* The method works in three ways, dependent on argument value and current state:
[1193] Fix | Delete
* 1. HELO/EHLO has not been sent - returns null and populates $this->error.
[1194] Fix | Delete
* 2. HELO has been sent -
[1195] Fix | Delete
* $name == 'HELO': returns server name
[1196] Fix | Delete
* $name == 'EHLO': returns boolean false
[1197] Fix | Delete
* $name == any other string: returns null and populates $this->error
[1198] Fix | Delete
* 3. EHLO has been sent -
[1199] Fix | Delete
* $name == 'HELO'|'EHLO': returns the server name
[1200] Fix | Delete
* $name == any other string: if extension $name exists, returns True
[1201] Fix | Delete
* or its options (e.g. AUTH mechanisms supported). Otherwise returns False.
[1202] Fix | Delete
*
[1203] Fix | Delete
* @param string $name Name of SMTP extension or 'HELO'|'EHLO'
[1204] Fix | Delete
*
[1205] Fix | Delete
* @return string|bool|null
[1206] Fix | Delete
*/
[1207] Fix | Delete
public function getServerExt($name)
[1208] Fix | Delete
{
[1209] Fix | Delete
if (!$this->server_caps) {
[1210] Fix | Delete
$this->setError('No HELO/EHLO was sent');
[1211] Fix | Delete
[1212] Fix | Delete
return null;
[1213] Fix | Delete
}
[1214] Fix | Delete
[1215] Fix | Delete
if (!array_key_exists($name, $this->server_caps)) {
[1216] Fix | Delete
if ('HELO' === $name) {
[1217] Fix | Delete
return $this->server_caps['EHLO'];
[1218] Fix | Delete
}
[1219] Fix | Delete
if ('EHLO' === $name || array_key_exists('EHLO', $this->server_caps)) {
[1220] Fix | Delete
return false;
[1221] Fix | Delete
}
[1222] Fix | Delete
$this->setError('HELO handshake was used; No information about server extensions available');
[1223] Fix | Delete
[1224] Fix | Delete
return null;
[1225] Fix | Delete
}
[1226] Fix | Delete
[1227] Fix | Delete
return $this->server_caps[$name];
[1228] Fix | Delete
}
[1229] Fix | Delete
[1230] Fix | Delete
/**
[1231] Fix | Delete
* Get the last reply from the server.
[1232] Fix | Delete
*
[1233] Fix | Delete
* @return string
[1234] Fix | Delete
*/
[1235] Fix | Delete
public function getLastReply()
[1236] Fix | Delete
{
[1237] Fix | Delete
return $this->last_reply;
[1238] Fix | Delete
}
[1239] Fix | Delete
[1240] Fix | Delete
/**
[1241] Fix | Delete
* Read the SMTP server's response.
[1242] Fix | Delete
* Either before eof or socket timeout occurs on the operation.
[1243] Fix | Delete
* With SMTP we can tell if we have more lines to read if the
[1244] Fix | Delete
* 4th character is '-' symbol. If it is a space then we don't
[1245] Fix | Delete
* need to read anything else.
[1246] Fix | Delete
*
[1247] Fix | Delete
* @return string
[1248] Fix | Delete
*/
[1249] Fix | Delete
protected function get_lines()
[1250] Fix | Delete
{
[1251] Fix | Delete
//If the connection is bad, give up straight away
[1252] Fix | Delete
if (!is_resource($this->smtp_conn)) {
[1253] Fix | Delete
return '';
[1254] Fix | Delete
}
[1255] Fix | Delete
$data = '';
[1256] Fix | Delete
$endtime = 0;
[1257] Fix | Delete
stream_set_timeout($this->smtp_conn, $this->Timeout);
[1258] Fix | Delete
if ($this->Timelimit > 0) {
[1259] Fix | Delete
$endtime = time() + $this->Timelimit;
[1260] Fix | Delete
}
[1261] Fix | Delete
$selR = [$this->smtp_conn];
[1262] Fix | Delete
$selW = null;
[1263] Fix | Delete
while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
[1264] Fix | Delete
//Must pass vars in here as params are by reference
[1265] Fix | Delete
//solution for signals inspired by https://github.com/symfony/symfony/pull/6540
[1266] Fix | Delete
set_error_handler([$this, 'errorHandler']);
[1267] Fix | Delete
$n = stream_select($selR, $selW, $selW, $this->Timelimit);
[1268] Fix | Delete
restore_error_handler();
[1269] Fix | Delete
[1270] Fix | Delete
if ($n === false) {
[1271] Fix | Delete
$message = $this->getError()['detail'];
[1272] Fix | Delete
[1273] Fix | Delete
$this->edebug(
[1274] Fix | Delete
'SMTP -> get_lines(): select failed (' . $message . ')',
[1275] Fix | Delete
self::DEBUG_LOWLEVEL
[1276] Fix | Delete
);
[1277] Fix | Delete
[1278] Fix | Delete
//stream_select returns false when the `select` system call is interrupted
[1279] Fix | Delete
//by an incoming signal, try the select again
[1280] Fix | Delete
if (stripos($message, 'interrupted system call') !== false) {
[1281] Fix | Delete
$this->edebug(
[1282] Fix | Delete
'SMTP -> get_lines(): retrying stream_select',
[1283] Fix | Delete
self::DEBUG_LOWLEVEL
[1284] Fix | Delete
);
[1285] Fix | Delete
$this->setError('');
[1286] Fix | Delete
continue;
[1287] Fix | Delete
}
[1288] Fix | Delete
[1289] Fix | Delete
break;
[1290] Fix | Delete
}
[1291] Fix | Delete
[1292] Fix | Delete
if (!$n) {
[1293] Fix | Delete
$this->edebug(
[1294] Fix | Delete
'SMTP -> get_lines(): select timed-out in (' . $this->Timelimit . ' sec)',
[1295] Fix | Delete
self::DEBUG_LOWLEVEL
[1296] Fix | Delete
);
[1297] Fix | Delete
break;
[1298] Fix | Delete
}
[1299] Fix | Delete
[1300] Fix | Delete
//Deliberate noise suppression - errors are handled afterwards
[1301] Fix | Delete
$str = @fgets($this->smtp_conn, self::MAX_REPLY_LENGTH);
[1302] Fix | Delete
$this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL);
[1303] Fix | Delete
$data .= $str;
[1304] Fix | Delete
//If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled),
[1305] Fix | Delete
//or 4th character is a space or a line break char, we are done reading, break the loop.
[1306] Fix | Delete
//String array access is a significant micro-optimisation over strlen
[1307] Fix | Delete
if (!isset($str[3]) || $str[3] === ' ' || $str[3] === "\r" || $str[3] === "\n") {
[1308] Fix | Delete
break;
[1309] Fix | Delete
}
[1310] Fix | Delete
//Timed-out? Log and break
[1311] Fix | Delete
$info = stream_get_meta_data($this->smtp_conn);
[1312] Fix | Delete
if ($info['timed_out']) {
[1313] Fix | Delete
$this->edebug(
[1314] Fix | Delete
'SMTP -> get_lines(): stream timed-out (' . $this->Timeout . ' sec)',
[1315] Fix | Delete
self::DEBUG_LOWLEVEL
[1316] Fix | Delete
);
[1317] Fix | Delete
break;
[1318] Fix | Delete
}
[1319] Fix | Delete
//Now check if reads took too long
[1320] Fix | Delete
if ($endtime && time() > $endtime) {
[1321] Fix | Delete
$this->edebug(
[1322] Fix | Delete
'SMTP -> get_lines(): timelimit reached (' .
[1323] Fix | Delete
$this->Timelimit . ' sec)',
[1324] Fix | Delete
self::DEBUG_LOWLEVEL
[1325] Fix | Delete
);
[1326] Fix | Delete
break;
[1327] Fix | Delete
}
[1328] Fix | Delete
}
[1329] Fix | Delete
[1330] Fix | Delete
return $data;
[1331] Fix | Delete
}
[1332] Fix | Delete
[1333] Fix | Delete
/**
[1334] Fix | Delete
* Enable or disable VERP address generation.
[1335] Fix | Delete
*
[1336] Fix | Delete
* @param bool $enabled
[1337] Fix | Delete
*/
[1338] Fix | Delete
public function setVerp($enabled = false)
[1339] Fix | Delete
{
[1340] Fix | Delete
$this->do_verp = $enabled;
[1341] Fix | Delete
}
[1342] Fix | Delete
[1343] Fix | Delete
/**
[1344] Fix | Delete
* Get VERP address generation mode.
[1345] Fix | Delete
*
[1346] Fix | Delete
* @return bool
[1347] Fix | Delete
*/
[1348] Fix | Delete
public function getVerp()
[1349] Fix | Delete
{
[1350] Fix | Delete
return $this->do_verp;
[1351] Fix | Delete
}
[1352] Fix | Delete
[1353] Fix | Delete
/**
[1354] Fix | Delete
* Set error messages and codes.
[1355] Fix | Delete
*
[1356] Fix | Delete
* @param string $message The error message
[1357] Fix | Delete
* @param string $detail Further detail on the error
[1358] Fix | Delete
* @param string $smtp_code An associated SMTP error code
[1359] Fix | Delete
* @param string $smtp_code_ex Extended SMTP code
[1360] Fix | Delete
*/
[1361] Fix | Delete
protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')
[1362] Fix | Delete
{
[1363] Fix | Delete
$this->error = [
[1364] Fix | Delete
'error' => $message,
[1365] Fix | Delete
'detail' => $detail,
[1366] Fix | Delete
'smtp_code' => $smtp_code,
[1367] Fix | Delete
'smtp_code_ex' => $smtp_code_ex,
[1368] Fix | Delete
];
[1369] Fix | Delete
}
[1370] Fix | Delete
[1371] Fix | Delete
/**
[1372] Fix | Delete
* Set debug output method.
[1373] Fix | Delete
*
[1374] Fix | Delete
* @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it
[1375] Fix | Delete
*/
[1376] Fix | Delete
public function setDebugOutput($method = 'echo')
[1377] Fix | Delete
{
[1378] Fix | Delete
$this->Debugoutput = $method;
[1379] Fix | Delete
}
[1380] Fix | Delete
[1381] Fix | Delete
/**
[1382] Fix | Delete
* Get debug output method.
[1383] Fix | Delete
*
[1384] Fix | Delete
* @return string
[1385] Fix | Delete
*/
[1386] Fix | Delete
public function getDebugOutput()
[1387] Fix | Delete
{
[1388] Fix | Delete
return $this->Debugoutput;
[1389] Fix | Delete
}
[1390] Fix | Delete
[1391] Fix | Delete
/**
[1392] Fix | Delete
* Set debug output level.
[1393] Fix | Delete
*
[1394] Fix | Delete
* @param int $level
[1395] Fix | Delete
*/
[1396] Fix | Delete
public function setDebugLevel($level = 0)
[1397] Fix | Delete
{
[1398] Fix | Delete
$this->do_debug = $level;
[1399] Fix | Delete
}
[1400] Fix | Delete
[1401] Fix | Delete
/**
[1402] Fix | Delete
* Get debug output level.
[1403] Fix | Delete
*
[1404] Fix | Delete
* @return int
[1405] Fix | Delete
*/
[1406] Fix | Delete
public function getDebugLevel()
[1407] Fix | Delete
{
[1408] Fix | Delete
return $this->do_debug;
[1409] Fix | Delete
}
[1410] Fix | Delete
[1411] Fix | Delete
/**
[1412] Fix | Delete
* Set SMTP timeout.
[1413] Fix | Delete
*
[1414] Fix | Delete
* @param int $timeout The timeout duration in seconds
[1415] Fix | Delete
*/
[1416] Fix | Delete
public function setTimeout($timeout = 0)
[1417] Fix | Delete
{
[1418] Fix | Delete
$this->Timeout = $timeout;
[1419] Fix | Delete
}
[1420] Fix | Delete
[1421] Fix | Delete
/**
[1422] Fix | Delete
* Get SMTP timeout.
[1423] Fix | Delete
*
[1424] Fix | Delete
* @return int
[1425] Fix | Delete
*/
[1426] Fix | Delete
public function getTimeout()
[1427] Fix | Delete
{
[1428] Fix | Delete
return $this->Timeout;
[1429] Fix | Delete
}
[1430] Fix | Delete
[1431] Fix | Delete
/**
[1432] Fix | Delete
* Reports an error number and string.
[1433] Fix | Delete
*
[1434] Fix | Delete
* @param int $errno The error number returned by PHP
[1435] Fix | Delete
* @param string $errmsg The error message returned by PHP
[1436] Fix | Delete
* @param string $errfile The file the error occurred in
[1437] Fix | Delete
* @param int $errline The line number the error occurred on
[1438] Fix | Delete
*/
[1439] Fix | Delete
protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0)
[1440] Fix | Delete
{
[1441] Fix | Delete
$notice = 'Connection failed.';
[1442] Fix | Delete
$this->setError(
[1443] Fix | Delete
$notice,
[1444] Fix | Delete
$errmsg,
[1445] Fix | Delete
(string) $errno
[1446] Fix | Delete
);
[1447] Fix | Delete
$this->edebug(
[1448] Fix | Delete
"$notice Error #$errno: $errmsg [$errfile line $errline]",
[1449] Fix | Delete
self::DEBUG_CONNECTION
[1450] Fix | Delete
);
[1451] Fix | Delete
}
[1452] Fix | Delete
[1453] Fix | Delete
/**
[1454] Fix | Delete
* Extract and return the ID of the last SMTP transaction based on
[1455] Fix | Delete
* a list of patterns provided in SMTP::$smtp_transaction_id_patterns.
[1456] Fix | Delete
* Relies on the host providing the ID in response to a DATA command.
[1457] Fix | Delete
* If no reply has been received yet, it will return null.
[1458] Fix | Delete
* If no pattern was matched, it will return false.
[1459] Fix | Delete
*
[1460] Fix | Delete
* @return bool|string|null
[1461] Fix | Delete
*/
[1462] Fix | Delete
protected function recordLastTransactionID()
[1463] Fix | Delete
{
[1464] Fix | Delete
$reply = $this->getLastReply();
[1465] Fix | Delete
[1466] Fix | Delete
if (empty($reply)) {
[1467] Fix | Delete
$this->last_smtp_transaction_id = null;
[1468] Fix | Delete
} else {
[1469] Fix | Delete
$this->last_smtp_transaction_id = false;
[1470] Fix | Delete
foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
[1471] Fix | Delete
$matches = [];
[1472] Fix | Delete
if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
[1473] Fix | Delete
$this->last_smtp_transaction_id = trim($matches[1]);
[1474] Fix | Delete
break;
[1475] Fix | Delete
}
[1476] Fix | Delete
}
[1477] Fix | Delete
}
[1478] Fix | Delete
[1479] Fix | Delete
return $this->last_smtp_transaction_id;
[1480] Fix | Delete
}
[1481] Fix | Delete
[1482] Fix | Delete
/**
[1483] Fix | Delete
* Get the queue/transaction ID of the last SMTP transaction
[1484] Fix | Delete
* If no reply has been received yet, it will return null.
[1485] Fix | Delete
* If no pattern was matched, it will return false.
[1486] Fix | Delete
*
[1487] Fix | Delete
* @return bool|string|null
[1488] Fix | Delete
*
[1489] Fix | Delete
* @see recordLastTransactionID()
[1490] Fix | Delete
*/
[1491] Fix | Delete
public function getLastTransactionID()
[1492] Fix | Delete
{
[1493] Fix | Delete
return $this->last_smtp_transaction_id;
[1494] Fix | Delete
}
[1495] Fix | Delete
}
[1496] Fix | Delete
[1497] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function