[FX.php List] Multiple recipients for Fx email error routine?

Steve Winter steve at bluecrocodile.co.nz
Mon Jun 15 08:45:51 MDT 2009


Hi Jonathan,

Well given that the mailing routine within FX uses the PHP mail()  
function, then you could modify that to include a fourth parameter  
which included a CC... In my v of FX (4.2) lines 23- 37 include this  
data/function;

$webmasterEmailAddress = 'webmaster at yourdomain.com';
$emailFromAddress = 'you at yourdomain.com';

function EmailError ($errorText)
{
     global $webmasterEmailAddress;
     global $emailFromAddress;

     if (EMAIL_ERROR_MESSAGES) {
         $emailSubject = "PHP Server Error";
         $emailMessage = "The following error just occured:\r\n\r 
\nMessage: {$errorText}\r\n\r\n**This is an automated message**";
         $emailStatus = mail($webmasterEmailAddress, $emailSubject,  
$emailMessage, "From: $emailFromAddress\r\n");
     }
}

The fourth parameter in mail()  is the optional headers parameter,  
which you could expand to add in a CC, so you could define a new  
variable $ccEmail, and include that so that the headers becomes "From:  
$emailFromAddress\r\n CC: $ccEmail\r\n"

Don't forget to include the new $ccEmail variable in the global  
declaration if you declare it with the others at the top and outside  
the EmailError function...

HTH

Cheers
Steve

On 15 Jun 2009, at 15:26, Jonathan Schwartz wrote:

> Hi folks,
>
> I want to be able to have FX.php's built in email error routine send  
> to 2 recipients, not just one.
>
> Anyone done this?
>
> Thx
>
> Jonathan
> -- 
> Jonathan Schwartz
> Exit 445 Group
> jonathan at exit445.com
> http://www.exit445.com
> 415-370-5011
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list


Steve Winter
steve at bluecrocodile.co.nz
m: +44 77 7852 4776
3 Calshot Court, Channel Way
Ocean Village, Southampton SO14 3GR

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20090615/45d7a6e0/attachment.html


More information about the FX.php_List mailing list