Last active
December 20, 2015 03:48
-
-
Save baamenabar/6066136 to your computer and use it in GitHub Desktop.
Little funtion for letting the webmaste know there's been something wrong on the server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$nombreMarca = 'Client Brand'; | |
$mailAministrador = '[email protected]'; | |
$mailWebmaster = '[email protected]'; | |
//the above are usually already on the script. | |
function avisaWebmaster($message=''){ | |
$message.="\r\n\r\nen la fecha:".date('Y-n-d H:i:s'); | |
$message.="\r\n\r\nen el archivo:".$_SERVER['PHP_SELF']."\r\nllamdo en:".$_SERVER['REQUEST_URI']; | |
$message.="\r\n\r\ncon la info:".@print_r( $_SERVER, true ); | |
global $mailWebmaster; | |
global $nombreMarca; | |
global $mailAministrador; | |
$to=$mailWebmaster; | |
$subject = 'Error en sitio'.$nombreMarca; | |
$additionalHeaders = "From: Soporte $nombreMarca <".$mailAministrador.">\n"; | |
$additionalHeaders .= 'MIME-Version: 1.0' . "\n"; | |
$additionalHeaders .= 'Content-type: text/plain; charset=utf-8' . "\n"; | |
@mail($to, $subject,$message,$additionalHeaders); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment