List:General Discussion« Previous MessageNext Message »
From:Stan P. van de Burgt Date:April 14 1999 10:38pm
Subject:Re: Former mSQL user
View as plain text  
Hi Stephen,

>How do I code a PHP program 
>to send mail from the server based on info from the form or in case 
>the MySQL daemon is down.  Any assistance would be great.

How about this (not checked, just the general idea):

      $alertaddr = "tomalock@stripped";
      $from = "php@yourdomain";
      if (mysql_ping($db)) {
          $body = mysql_error();
             mail($alertaddr, "MySQL error", $body, 
               "From: $from\nReturn-Path: <$from>");
          echo "<b>".mysql_error()."</b>";
          exit;
      }

Stan

--
Stan P. van de Burgt                 stan@stripped (0x853296C5)
DMO, P.O. box 1248, 3500 AE, Utrecht, the Netherlands 
Thread
Former mSQL userStephen Johnson15 Apr
  • Re: Former mSQL userStan P. van de Burgt15 Apr