PHP Mail via Exim Better Return Primer Tutorial

PHP Mail via Exim Better Return Primer Tutorial

PHP Mail via Exim Better Return Primer Tutorial

We are exploring a way to improve on the PHP mail 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 Exim mail server logs.

We are turning to a crontab operated (ie. scheduled) call to a new …

… to, in our MAMP local Apache web server wooooorrrrrlllllddd would work with either …


echo '/Applications/MAMP/htdocs/ "2022-12-20 11:4[01]"' > snapshotexim.txt
ksh ./snapshotexim.ksh # may populate /Applications/MAMP/htdocs/snapshotexim.php

… or …


echo '' > snapshotexim.txt
ksh ./snapshotexim.ksh /Applications/MAMP/htdocs/ "2022-12-20 11:4[01]" # may populate /Applications/MAMP/htdocs/snapshotexim.php

… methodologies to place a relevant “slice” (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’s Document Root called snapshotexim.php for ongoing local work to follow.

We prefer the first way because our future PHP interfacing can better write out “the intelligence” into snapshotexim.txt itself.

Up with crontab, in a Korn Shell procedure that runs every minute, we place (code like) …


if [ -f "$HOME/snapshotexim.txt" ]; then
if [ -f "/etc/init.d/snapshotexim.ksh" ]; then
ksh /etc/init.d/snapshotexim.ksh
fi
fi

… ready for our journey of discovery to continue!

Did you know?

If you are thinking of implementing a solution of this ilk, within the next phase of the procedures we’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 eximsnapshot.php as some sort of starting point.

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Operating System, Software, Tutorials and tagged , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>