[thelist] PHP Mail() function

Bob Meetin bobm at dottedi.biz
Sat May 31 10:12:41 CDT 2014


Hmm, and if the error or mail logs are not giving you anything meaningful, you can probably add a few lines of code to your php script using fopen and fwrite to create your own text logfile. You could also dabble and change the script to pull a couple different lines for tests. Eliminate one variable at a time.

<?php

$datetime = date('Y-m-d-H-i-s');

$text --> maybe some output from the query, up to you

if ( some_condition ) // optional
{
   $logfile = "$path/log.txt";
   $fpi = fopen("$logfile", "a"); // a to append
   fwrite($fpi, "$datetime|$text|$text2\n");
   fclose ($fpi);
}

?>

On 05/31/2014 08:58 AM, Hassan Schroeder wrote:
> On Fri, May 30, 2014 at 4:25 PM, Santilal Parbhu
> <santilal at scorpioneng.co.nz> wrote:
>
>> Hey thanks for the help.  However, I have found that I am barking up the
>> wrong tree.  I inserted a test script and found that it worked.  So then I
>> disabled everything in my script that accesses the database and essentially
>> just left the mail() part.  This also worked.  So there must be something in
>> the data that I select that is stopping the email going out.  Perhaps a
>> control character or similar.  Is this possible.
> Anything's possible :-)
>
> However, to repeat: what's in the logs? If mail sending is failing due
> to some charset/encoding issue, I would expect to see that logged.
>
> Actual data from your environment trumps guessing in most cases...
>


-- 
Bob Meetin
www.dottedi.biz
303-926-0167 (m)



More information about the thelist mailing list