{"id":57829,"date":"2022-12-22T03:01:22","date_gmt":"2022-12-21T17:01:22","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=57829"},"modified":"2022-12-21T17:24:28","modified_gmt":"2022-12-21T07:24:28","slug":"php-mail-via-exim-better-return-deployment-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-mail-via-exim-better-return-deployment-tutorial\/","title":{"rendered":"PHP Mail via Exim Better Return Deployment Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/snapshotexim.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"PHP Mail via Exim Better Return Deployment Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/php_mail_return_re_exim.jpg\" title=\"PHP Mail via Exim Better Return Deployment Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Mail via Exim Better Return Deployment Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='PHP Mail via Exim Better Return Primer Tutorial' href='#phpmebrpt'>PHP Mail via Exim Better Return Primer Tutorial<\/a> set up a &#8230;<\/p>\n<ul>\n<li>framework part of an overall solution to a way to nuance PHP <a target=_blank title='PHP mail function' href='https:\/\/www.php.net\/manual\/en\/function.mail.php'>mail<\/a>&#8216;s return value, in an <a target=_blank title='Exim' href='https:\/\/www.exim.org\/'>Exim<\/a> Mail Server environment &#8230; and today &#8230;<\/li>\n<li>we present a &#8220;use of&#8221; this framework for a &#8220;total solution&#8221; for a particular application need<\/li>\n<\/ul>\n<p>Too boring for you?!  But you see &#8230;<\/p>\n<ul>\n<li>any non-synchronous scenario is bound to involve a &#8220;somewhat messy&#8221; arrangement &#8230; and &#8230;<\/li>\n<li>the framework is solid and can remain, and the &#8220;use of&#8221; is fairly easily mimicked for another application usage &#8230; and &#8230;<\/li>\n<li>parts of the &#8220;use of&#8221; to an &#8220;always used&#8221; by us tool web application which sends inline HTML emails (and so, effectively becomes merged into the &#8220;framework&#8221; of the solution) lessens the impact of the &#8220;somewhat messy&#8221; description above<\/li>\n<\/ul>\n<p>To summarize, at least for us, we see this as a useful step forward, and besides that, we want to put this down in words.<\/p>\n<p>Okay, to that last point above, we have the <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emailhtml.php-------------------------GETME\">now changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/emailhtml.php-------------------------GETME\">emailhtml.php<\/a> we use most often, in combination with <a target=_blank title='Ajax information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Ajax_%28programming%29'>Ajax<\/a> and <a target=_blank title='FormData object information' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/FormData'>FormData<\/a> to send out inline HTML (form) emails via our Exim Mail Server via PHP mail function.  <font color=blue>It changed<\/font> in a function &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n<font color=blue>$isinline=false;<br \/>\nif (isset($_GET['inline']) || isset($_POST['inline'])) { $isinline=true; }<\/font><br \/>\n<br \/>\nfunction zmail($zris, $zxsis, $ztis, $zhis) {<br \/>\n     global $subjarr, $fflist, $ffname, $localdt, $fromer<font color=blue>, $isinline<\/font>;<br \/>\n     \/\/ file_put_contents(\"091.091\",\"\");<br \/>\n     if (strpos($zxsis, \"[\") === false && strpos($zxsis, \"&lt;\") === false && $zxsis != \"\") {<br \/>\n        $zxsis.=\" at [date] for [files]\";<br \/>\n    \/\/ file_put_contents(\"092.092\",$zxsis);<br \/>\n        analtoken($zxsis, \"\");<br \/>\n     }<br \/>\n    \/\/ file_put_contents(\"093.093\",$fflist);<br \/>\n     subjtokenization($fflist, \"files\");<br \/>\n     subjtokenization($ffname, \"name\");<br \/>\n    \/\/ file_put_contents(\"094.094\",$subjarr[0]);<br \/>\n     if ($ffname == \"\") { $zhis=str_replace(\"&lt;files&gt;\", $fflist, str_replace(\"[files]\", $fflist, $zhis)); }<br \/>\n     $zhis=str_replace(\"&lt;files&gt;\", $fflist, str_replace(\"[files]\", $fflist, str_replace(\"&lt;name&gt;\", $ffname, str_replace(\"[name]\", $ffname, $zhis))));<br \/>\n    \/\/ file_put_contents(\"095.095\",$xsis);<br \/>\n     \/\/$xretmd=\"\";<br \/>\n     \/\/$xxretmd=\"\";<br \/>\n<br \/>\n     <font color=blue>if ($isinline && (isset($_GET['waitforreturn']) || isset($_POST['waitforreturn']))) { \/\/ relies on crontab scheduling of snapshotexim.ksh<br \/>\n      $refd='' . date(\"Y-m-d H:i:s\");<br \/>\n      $cursecs=explode(':', $refd)[2];<br \/>\n      $curtens=substr($cursecs,0,1);<br \/>\n      $subsecs=substr($cursecs,1,1);<br \/>\n      if ($cursecs &gt; 56) {<br \/>\n       sleep((61 - $cursecs));<br \/>\n       $refd='' . date(\"Y-m-d H:i:s\");<br \/>\n       $cursecs=explode(':', $refd)[2];<br \/>\n       $curtens=substr($cursecs,0,1);<br \/>\n       $subsecs=substr($cursecs,1,1);<br \/>\n      } else if ($subsecs &gt; 6) {<br \/>\n       sleep((11 - $subsecs));<br \/>\n       $refd='' . date(\"Y-m-d H:i:s\");<br \/>\n       $cursecs=explode(':', $refd)[2];<br \/>\n       $curtens=substr($cursecs,0,1);<br \/>\n       $subsecs=substr($cursecs,1,1);<br \/>\n      }<br \/>\n      if ($curtens &lt; 5) {<br \/>\n       $refd=substr($refd, 0, 17) . '[' . $curtens . (1 + $curtens) . ']';<br \/>\n      }<br \/>\n      if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . \"snapshotexim.php\")) {<br \/>\n        unlink($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . \"snapshotexim.php\");<br \/>\n      }<br \/>\n      if (strpos($refd, \"[\") !== false) {<br \/>\n        file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . \"snapshotexim.txt\", '' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . ' \"' . substr($refd, 0, 21) . '\"');<br \/>\n        exec('chmod 666 ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . \"snapshotexim.txt\");<br \/>\n      } else {<br \/>\n        file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . \"snapshotexim.txt\", '' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . ' \"' . substr($refd, 0, 18) . '\"');<br \/>\n        exec('chmod 666 ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . \"snapshotexim.txt\");<br \/>\n      }<br \/>\n     }<\/font><br \/>\n<br \/>\n     <font color=blue>$outretm=<\/font>mail($zris, subjtokenization($zxsis,\"subject\"), $ztis, $zhis);<br \/>\n<br \/> <br \/>\n     <font color=blue>if ($isinline && (isset($_GET['waitforreturn']) || isset($_POST['waitforreturn']))) { \/\/ relies on crontab scheduling of snapshotexim.ksh<br \/>\n      $maxwait=91;<br \/>\n      $curwait=0;<br \/>\n      while ($curwait &lt; $maxwait && !file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . \"snapshotexim.php\")) {<br \/>\n        sleep(1);<br \/>\n        $curwait++;<br \/>\n      }<br \/>\n      $reth=\"\";<br \/>\n      if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . \"snapshotexim.php\")) {<br \/>\n        $reth=file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . \"snapshotexim.php\");<br \/>\n        if (strpos($reth, \"no immediate delivery:\") !== false) {<br \/>\n          echo \"&lt;html&gt;&lt;body&gt;&lt;p&gt;no immediate delivery&lt;\/p&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n          exit;<br \/>\n        } else {<br \/>\n          echo \"&lt;html&gt;&lt;body&gt;&lt;p&gt;delivered from exim&lt;\/p&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n          exit;<br \/>\n        }<br \/>\n      } else {<br \/>\n        echo \"&lt;html&gt;&lt;body&gt;&lt;p&gt;not sure if exim delivered&lt;\/p&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n        exit;<br \/>\n      }<br \/>\n     }<\/font><br \/>\n<br \/> <br \/>\n     return <font color=blue>$outretm<\/font>;<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; telling us the caller of this Exim emailing PHP tool needs to define a new argument called <i>waitforreturn<\/i> and the usual argument called <i>inline<\/i> for this solution to kick in.  With our recent Sudoku game (that we last talked about with <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/phphtmljavascript-sudoku-game-inline-html-email-tutorial\/' title='PHP\/HTML\/Javascript Sudoku Game Inline HTML Email Tutorial'>PHP\/HTML\/Javascript Sudoku Game Inline HTML Email Tutorial<\/a>) we started to <font color=blue>make that happen<\/font> &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n <font color=blue>function stateChanged() {<br \/>\n if (zhr.readyState == 4) {<br \/>\n  if (zhr.status == 200) {<br \/>\n   if (zhr.response.indexOf('no immediate delivery') != -1) {<br \/>\n     aeclick(document.getElementById('aemail'));<br \/>\n   } else {<br \/>\n     preaeto='';<br \/>\n     presubj='';<br \/>\n   }<br \/>\n  }<br \/>\n }<br \/>\n }<\/font><br \/>\n  <br \/> <br \/>\n   function simemail() {<br \/>\n     var aeto='newwindow';<br \/>\n     \/\/alert('here');<br \/>\n     thenums='';<br \/>\n     var esels=document.getElementsByTagName('select');<br \/>\n     for (var ejj=0; ejj&lt;esels.length; ejj++) {<br \/>\n      if (('' + esels[ejj].id) != 'smode') {<br \/>\n        thenums+=retcn(esels[ejj].getAttribute('data-answer'));<br \/>\n      }<br \/>\n     }<br \/>\n     var dspare=''<br \/>\n     var dbi=document.body.innerHTML;<br \/>\n     if (document.URL.indexOf('hard=') != -1 || ('' + location.hash).indexOf('hard') != -1) {<br \/>\n       if (1 == 1) {<br \/>\n       dbi=dbi.replace('\\\"easy\\\"&gt;Easy&lt;\/option&gt;', '\\\"hard\\\"&gt;Easy&lt;\/option&gt;').replace('\\\"hard\\\"&gt;Hard&lt;\/option&gt;', '\\\"easy\\\"&gt;Easy&lt;\/option&gt;').replace('\\\"hard\\\"&gt;Easy&lt;\/option&gt;', '\\\"hard\\\"&gt;Hard&lt;\/option&gt;');<br \/>\n       predbi=predbi.replace('\\\"easy\\\"&gt;Easy&lt;\/option&gt;', '\\\"hard\\\"&gt;Easy&lt;\/option&gt;').replace('\\\"hard\\\"&gt;Hard&lt;\/option&gt;', '\\\"easy\\\"&gt;Easy&lt;\/option&gt;').replace('\\\"hard\\\"&gt;Easy&lt;\/option&gt;', '\\\"hard\\\"&gt;Hard&lt;\/option&gt;');<br \/>\n       } else {<br \/>\n       dbi=dbi.replace('&gt;Hard&lt;\/option&gt;', ' selected&gt;Hard&lt;\/option&gt;');<br \/>\n       predbi=predbi.replace('&gt;Hard&lt;\/option&gt;', ' selected&gt;Hard&lt;\/option&gt;');<br \/>\n       }<br \/>\n     }<br \/>\n     dbi=dbi.replace('\\\" border=', 'text-align:center;\\\" border=').replace(\/\\.\\\/index\\.php\/g, document.URL.split('?')[0].split('#')[0]).replace(\/\\ class\\=\\\"bright\\ bbottom\\\"\/g, ' style=\\\"border-right:3px solid black;border-bottom:3px solid black;\\\"  class\\=\\\"bright\\ bbottom\\\"').replace(\/\\ class\\=\\\"bright\\\"\/g, ' style=\\\"border-right:3px solid black;\\\"  class\\=\\\"bright\\\"').replace(\/\\ class\\=\\\"bbottom\\\"\/g, ' style=\\\"border-bottom:3px solid black;\\\"  class\\=\\\"bbottom\\\"');<br \/>\n     predbi=predbi.replace('\\\" border=', 'text-align:center;\\\" border=').replace(\/\\.\\\/index\\.php\/g, document.URL.split('?')[0].split('#')[0]).replace(\/\\ class\\=\\\"bright\\ bbottom\\\"\/g, ' style=\\\"border-right:3px solid black;border-bottom:3px solid black;\\\"  class\\=\\\"bright\\ bbottom\\\"').replace(\/\\ class\\=\\\"bright\\\"\/g, ' style=\\\"border-right:3px solid black;\\\"  class\\=\\\"bright\\\"').replace(\/\\ class\\=\\\"bbottom\\\"\/g, ' style=\\\"border-bottom:3px solid black;\\\"  class\\=\\\"bbottom\\\"');<br \/>\n     var dbis=dbi.split(' id=\\\"s'), dbiss=[];<br \/>\n     var pdbis=predbi.split(' id=\\\"s');<br \/>\n     var mustbe=0, imust=0, gval='';<br \/>\n     for (var idb=1; idb&lt;dbis.length; idb++) {<br \/>\n       dspare=dbis[idb].split('\\\"')[0];<br \/>\n       if (dspare == '' + mustbe) {<br \/>\n       mustbe++;<br \/>\n       if (dbi.indexOf(' name=\\\"s' + dspare + '\\\"') == -1) {<br \/>\n         if (dbis[idb].indexOf(' disabled') != -1) {<br \/>\n         gval=eval(10 - eval(dbis[idb].split(' value=\\\"')[1].split('\\\"')[0]));<br \/>\n         \/\/alert(dbis[idb].replace('&gt;&lt;\/option&gt;','&gt;' + gval + '&lt;\/option&gt;') + ' ... ' + dbis[idb]);<br \/>\n         if (dbis[idb].indexOf('&gt; &lt;\/option&gt;') != -1) {<br \/>\n         dbi=dbi.replace(dbis[idb], dbis[idb].replace('&gt; &lt;\/option&gt;','&gt;' + emj(gval) + '&lt;\/option&gt;').replace(' disabled', ' data-disabled'));<br \/>\n         predbi=predbi.replace(pdbis[idb], pdbis[idb].replace('&gt; &lt;\/option&gt;','&gt;' + (gval) + '&lt;\/option&gt;').replace(' disabled', ' data-disabled'));<br \/>\n         } else {<br \/>\n         dbi=dbi.replace(dbis[idb], dbis[idb].replace('&gt;&lt;\/option&gt;','&gt;' + emj(gval) + '&lt;\/option&gt;').replace(' disabled', ' data-disabled'));<br \/>\n         predbi=predbi.replace(pdbis[idb], pdbis[idb].replace('&gt;&lt;\/option&gt;','&gt;' + (gval) + '&lt;\/option&gt;').replace(' disabled', ' data-disabled'));<br \/>\n         }<br \/>\n         dbi=dbi.replace(' id=\\\"s' + dspare + '\\\"', ' id=\\\"s' + dspare + '\\\"' + ' name=\\\"s' + dspare + '\\\" value=\\\"' + gval + '\\\"');<br \/>\n         predbi=predbi.replace(' id=\\\"s' + dspare + '\\\"', ' id=\\\"s' + dspare + '\\\"' + ' name=\\\"s' + dspare + '\\\" value=\\\"' + gval + '\\\"');<br \/>\n         dbiss=dbi.split(' id=\\\"s');<br \/>\n         \/\/alert(dbiss[idb]);<br \/>\n         } else {<br \/>\n         dbi=dbi.replace(' id=\\\"s' + dspare + '\\\"', ' id=\\\"s' + dspare + '\\\"' + ' name=\\\"s' + dspare + '\\\"');<br \/>\n         predbi=predbi.replace(' id=\\\"s' + dspare + '\\\"', ' id=\\\"s' + dspare + '\\\"' + ' name=\\\"s' + dspare + '\\\"');<br \/>\n         }<br \/>\n       }<br \/>\n       }<br \/>\n     }<br \/>\n     \/\/alert(mustbe);<br \/>\n     if (document.URL.indexOf('newwindow=') == -1 && ('' + location.hash).indexOf('newwindow') == -1) {<br \/>\n   aeto=prompt('Please enter email address to invite regarding this Sudoku game in a form within the message. Prefixing blanks will try emoji characters within the form (which some email clients are okay with).  This methodology sometimes has delays and so we try another Sudoku game collaboration and sharing approach after that, in which you can optionally prefix by your Sudoku playing name and a : colon character, unless your email address is mixed case.  Enter newwindow for game in a new popup window instead, where all uppercase in a new web browser tab.  Optionally suffix by # followed by your email subject line [Sudoku game share invitation link]','');<br \/>\n     var trye=false;<br \/>\n     if (aeto.trim() != aeto) {<br \/>\n     trye=true;<br \/>\n     aeto=aeto.trim();<br \/>\n     }<br \/>\n     preaeto=aeto;<br \/>\n     presubj='';<br \/>\n     if (aeto.indexOf('#') != -1) {<br \/>\n      presubj=aeto.split('#')[1];<br \/>\n     }<br \/>\n     if (aeto.indexOf(':') != -1) {<br \/>\n       yourname=aeto.split(':')[0];<br \/>\n       mapfromto('\" . $weare . \"', yourname);<br \/>\n       document.getElementById('ibb').value=document.getElementById('ibb').value.replace(' your name', ' ' + yourname);<br \/>\n       aeto=aeto.replace(yourname + ':', '');<br \/>\n     }<br \/>\n   if (aeto.indexOf('@') != -1) {<br \/>\n   zhr = new XMLHttpRequest();<br \/>\n   zform=new FormData();<br \/>\n   <font color=blue>if (aeto.split('#')[0].toUpperCase() == aeto.split('#')[0] || aeto.split('#')[0].toLowerCase() == aeto.split('#')[0]) {<\/font><br \/>\n   zform.append('inline', '');<br \/>\n   <font color=blue>} else {<br \/>\n   zform.append('inline', '');<br \/>\n   zform.append('waitforreturn', 'y');<br \/>\n   }<\/font><br \/>\n   zform.append('to', aeto.replace(\/\\ \/g,'').replace(\/\\;\/g,',').split('#')[0]);<br \/>\n   if (aeto.indexOf('#') != -1) {<br \/>\n   zform.append('subject', aeto.split('#')[1]);<br \/>\n   } else {<br \/>\n   zform.append('subject', 'Sudoku game share invitation link');<br \/>\n   }<br \/>\n   if (trye) {<br \/>\n   zform.append('htmlis', '&lt;ht' + 'ml&gt;&lt;bo' + 'dy&gt;&lt;form method=GET action=' + document.URL.split('?')[0].split('&')[0].split('#')[0].replace('https:','http:').replace('?','#') + ' target=_blank&gt;' + dbi.replace('body style=', 'body data-style=').replace(\/\\&lt;button \/g,'&lt;button style=display:none; ') + '&lt;input type=hidden id=thenums name=thenums value=' + thenums + ' style=display:none;&gt;&lt;\/input&gt;\" . $hrd . \"&lt;input style=background-color:yellow; type=submit value=Check&gt;&lt;\/input&gt;&lt;\/form&gt;&lt;\/body&gt;&lt;\/html&gt;');<br \/>\n   } else {<br \/>\n   zform.append('htmlis', '&lt;ht' + 'ml&gt;&lt;bo' + 'dy&gt;&lt;form method=GET action=' + document.URL.split('?')[0].split('&')[0].split('#')[0].replace('https:','http:').replace('?','#') + ' target=_blank&gt;' + predbi.replace('body style=', 'body data-style=').replace(\/\\&lt;button \/g,'&lt;button style=display:none; ') + '&lt;input type=hidden id=thenums name=thenums value=' + thenums + ' style=display:none;&gt;&lt;\/input&gt;\" . $hrd . \"&lt;input style=background-color:yellow; type=submit value=Check&gt;&lt;\/input&gt;&lt;\/form&gt;&lt;\/body&gt;&lt;\/html&gt;');<br \/>\n   }<br \/>\n   <font color=blue>if (aeto.split('#')[0].toUpperCase() == aeto.split('#')[0] || aeto.split('#')[0].toLowerCase() == aeto.split('#')[0]) {<\/font><br \/>\n   zhr.open('post', '\/\/www.rjmprogramming.com.au\/HTMLCSS\/emailhtml.php', true);<br \/>\n   \/\/alert('not trying exim log look ' + aeto);<br \/>\n   <font color=blue>} else {<br \/>\n   zhr.onreadystatechange=stateChanged;<br \/>\n   zhr.open('post', '\/\/www.rjmprogramming.com.au\/HTMLCSS\/emailhtml.php?rand=' + Math.floor(Math.random() * 198765643), true);<br \/>\n   \/\/alert('trying exim log look ' + aeto);<br \/>\n   }<\/font><br \/>\n   zhr.send(zform);<br \/>\n   if (aeto.split('#')[0].toUpperCase() == aeto.split('#')[0] || aeto.split('#')[0].toLowerCase() == aeto.split('#')[0]) {<br \/>\n   aeclick(document.getElementById('aemail'));<br \/>\n   } <font color=blue>else {  \/\/ we now wait for an exim status return, so hang onto globals longer 21\/12\/2022<br \/>\n   if (1 == 11) { preaeto=''; }<br \/>\n   if (presubj == '') { presubj='Inline HTML Sudoku form delayed. ' + decodeURIComponent(document.getElementById('aemail').href.split('subject=')[1].split('&')[0]); if (preaeto.indexOf('#') == -1) { preaeto+='#' + presubj; } } else {  presubj='Inline HTML Sudoku form delayed. ' + presubj;  if (preaeto.indexOf('#') == -1) { preaeto+='#' + presubj; }  }<br \/>\n   }<\/font><br \/>\n   }<br \/>\n     }<br \/>\n     if ((document.URL.indexOf('newwindow=') != -1 || ('' + location.hash).indexOf('newwindow') != -1) || aeto.replace(' ','').toLowerCase().indexOf('newwindow') == 0 && aeto.indexOf('@') == -1) {<br \/>\n     if (aeto.replace(' ','').indexOf('NEWWINDOW') == 0) {<br \/>\n     wo=window.open('','_blank');<br \/>\n     } else {<br \/>\n     wo=window.open('','_blank','top=50,left=50,width=900,height=800');<br \/>\n     }<br \/>\n     wo.document.write('&lt;html&gt;&lt;head&gt;&lt;style&gt; .bright { border-right: 5px solid black; } .bbottom { border-bottom: 5px solid black; } td { font-size: 24px; width: 11%; height: 9%; text-align: center; vertical-align: middle; } select { font-size: 24px; } th { text-align: left; vertical-align: top; } &lt;\/style&gt;&lt;\/head&gt;&lt;body style=\\\" background-image: linear-gradient(to bottom right, rgb(255,255,255), rgb(224, 255, 255),rgb(175, 238, 238),rgb(173, 216, 230),rgb(135, 206, 235),rgb(135, 206, 250),rgb(0, 191, 255),rgb(30, 144, 255),rgb(100, 149, 237),rgb(123, 104, 238),rgb(65, 105, 225),rgb(0, 0, 255),rgb(0, 0, 205),rgb(0, 0, 139),rgb(0, 0, 128),rgb(25, 25, 112)); \\\"&gt;&lt;form method=GET action=' + document.URL.split('?')[0].split('&')[0].split('#')[0].replace('?','#') + ' target=_blank&gt;' + dbi.replace(\/\\&lt;button \/g,'&lt;button style=display:none; ').replace('81%;','78%') + '&lt;input type=hidden id=thenums name=thenums value=' + thenums + ' style=display:none;&gt;&lt;\/input&gt;\" . $hrd . \"&lt;input style=background-color:yellow; type=submit value=Check&gt;&lt;\/input&gt;&lt;\/form&gt;&lt;\/body&gt;&lt;\/html&gt;');<br \/>\n     }<br \/>\n   }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; meaning a <button style=\"border:5px dotted pink;  -webkit-appearance: none; border-radius: 10px; \" title=\"PHP Email Sudoku inline HTML email form or new window form\">&#128231;<\/button> button prompt window answer of <i>Robert:RMetcalfe15@gmail.com<\/i> (for example) in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/index.php------GETME\">the second chance inline HTML email collaboration and sharing logic for<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/index.php------GETME\">index.php<\/a> PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/\">Sudoku game<\/a> will try to email an inline HTML email to the recipient via PHP mail through RJM Programming&#8217;s Exim mail server and will wait around to examine the relevant snippet of the \/var\/log\/exim_mainlog log file to determine whether it should offer an &#8220;a&#8221; link &#8220;mailto&#8221; alternative approach because the logs show &#8220;no immediate delivery&#8221; in that relevant snippet of logging, while that <i>Robert:RMetcalfe15@gmail.com<\/i> was selected by the user to not offer this alternative with our <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/\">Sudoku game<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/new-php-mail-via-exim-better-return-primer-tutorial\/'>New PHP Mail via Exim Better Return Primer Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpmebrpt'>Previous relevant <a target=_blank title='PHP Mail via Exim Better Return Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-mail-via-exim-better-return-primer-tutorial\/'>PHP Mail via Exim Better Return Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/snapshotexim.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"PHP Mail via Exim Better Return Primer Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/snapshotexim.jpg\" title=\"PHP Mail via Exim Better Return Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Mail via Exim Better Return Primer Tutorial<\/p><\/div>\n<p>We are exploring a way to improve on the PHP <a target=_blank title='PHP mail function' href='https:\/\/www.php.net\/manual\/en\/function.mail.php'>mail<\/a> return value telling you nothing about whether the email gets off to the intended recipient.  One step, here at RJM Programming, is to verify if the email has immediately been sent off according to our <a target=_blank title='Exim' href='https:\/\/www.exim.org\/'>Exim<\/a> mail server logs.<\/p>\n<p>We are turning to a <a target=_blank title='crontab information from computerhope ... thanks' href='http:\/\/www.computerhope.com\/jargon\/c\/cron.htm'>crontab<\/a> operated (ie. scheduled) call to a new &#8230;<\/p>\n<ul>\n<li><a target=_blank title='Korn Shell' href='https:\/\/en.wikipedia.org\/wiki\/KornShell'>Korn Shell<\/a> script called <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/snapshotexim.ksh_GETME\">snapshotexim.ksh<\/a> &#8230; which looks out for the existence of a &#8230;<\/li>\n<li>file in our <a target=_blank title=Apache href='https:\/\/www.apache.org\/'>Apache<\/a> web server&#8217;s <a target=_blank title='Document Root' href='https:\/\/httpd.apache.org\/docs\/2.4\/urlmapping.html'>Document Root<\/a> called snapshotexim.txt<\/li>\n<\/ul>\n<p> &#8230; to, in our <a target=_blank title='MAMP' href='http:\/\/www.mamp.info'>MAMP<\/a> local Apache web server wooooorrrrrlllllddd would work with either &#8230;<\/p>\n<p><code><br \/>\n   echo '\/Applications\/MAMP\/htdocs\/ \"2022-12-20 11:4[01]\"' > snapshotexim.txt<br \/>\n   ksh .\/snapshotexim.ksh  # may populate \/Applications\/MAMP\/htdocs\/snapshotexim.php<br \/>\n<\/code><\/p>\n<p> &#8230; or &#8230;<\/p>\n<p><code><br \/>\n  echo '' > snapshotexim.txt<br \/>\n  ksh .\/snapshotexim.ksh \/Applications\/MAMP\/htdocs\/ \"2022-12-20 11:4[01]\"  # may populate \/Applications\/MAMP\/htdocs\/snapshotexim.php<br \/>\n<\/code><\/p>\n<p> &#8230; methodologies to place a relevant &#8220;slice&#8221; (dated 2022-12-20 11:40 or 2022-12-20 11:41) of the Exim mail server log into a file in our Apache web server&#8217;s Document Root called snapshotexim.php for ongoing local work to follow.<\/p>\n<p>We prefer the first way because our future PHP interfacing can better write out &#8220;the intelligence&#8221; into snapshotexim.txt itself.<\/p>\n<p>Up with crontab, in a Korn Shell procedure that runs every minute, we place (code like) &#8230;<\/p>\n<p><code><br \/>\nif [ -f \"$HOME\/snapshotexim.txt\" ]; then<br \/>\n if [ -f \"\/etc\/init.d\/snapshotexim.ksh\" ]; then<br \/>\n  ksh \/etc\/init.d\/snapshotexim.ksh<br \/>\n fi<br \/>\nfi<br \/>\n<\/code><\/p>\n<p> &#8230; ready for our journey of discovery to continue!<\/p>\n<p><b><i>Did you know?<\/i><\/b><\/p>\n<p>If you are thinking of implementing a solution of this ilk, within the next phase of the procedures we&#8217;ll tackle into the future, you will need a PHP reader of snapshotexim.php above, via file_get_contents or HTML and Javascript and Ajax reader such as <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/eximsnapshot.php_GETME\">eximsnapshot.php<\/a> as some sort of starting point.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d57819' onclick='var dv=document.getElementById(\"d57819\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/exim\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57819' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d57829' onclick='var dv=document.getElementById(\"d57829\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/tool\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57829' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday&#8217;s PHP Mail via Exim Better Return Primer Tutorial set up a &#8230; framework part of an overall solution to a way to nuance PHP mail&#8216;s return value, in an Exim Mail Server environment &#8230; and today &#8230; we present &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-mail-via-exim-better-return-deployment-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,12,14,29,37],"tags":[69,1614,274,4181,327,1750,380,2751,4180,418,2730,462,3572,4182,677,714,716,738,2240,744,932,997,3420,3998,1138,2664,2762,4183,2213,1411],"class_list":["post-57829","post","type-post","status-publish","format-standard","hentry","category-ajax","category-elearning","category-event-driven-programming","category-operating-system","category-tutorials","tag-ajax","tag-asynchronous","tag-crontab","tag-deploynet","tag-did-you-know","tag-document-root","tag-email","tag-exim","tag-exim-mail-server","tag-file","tag-formdata","tag-framework","tag-helper","tag-implement","tag-korn-shell","tag-local-web-server","tag-log","tag-mail","tag-mail-server","tag-mamp","tag-php","tag-programming","tag-return","tag-return-value","tag-shell","tag-slice","tag-snippet","tag-toolapache","tag-tutotial","tag-web-server"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/57829"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=57829"}],"version-history":[{"count":14,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/57829\/revisions"}],"predecessor-version":[{"id":57843,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/57829\/revisions\/57843"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=57829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=57829"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=57829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}