note 72836 added to ref.mail

From: Date: Fri, 02 Feb 2007 16:54:10 +0000
Subject: note 72836 added to ref.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-122569@lists.php.net to get a copy of this message
I find this a useful function, and it's a lot easier to read and edit than the proceeding set. Many thanks to the proceeding set though, since they taught me how to do it! <?php function mxcl_mail( $subject, $message ) { ob_start(); print_r( $GLOBALS ); $teh_globals = chunk_split( base64_encode( ob_get_clean() ) ); // base 64 encode $date = date( 'r' ); $phpversion = phpversion(); $boundary = md5( time() ); $filename = '$GLOBALS.txt'; $headers = <<<END From: $_SERVER[PHP_SELF] <php@$_SERVER[SERVER_NAME]> Date: $date X-Mailer: PHP v$phpversion MIME-Version: 1.0 Content-Type: multipart/related; boundary="$boundary" END; $message = <<<END --$boundary Content-Type: text/plain; charset="iso-9959-1" Content-Transfer-Encoding: 7bit $message --$boundary Content-Type: octet-stream; name="$filename" Content-Disposition: attachment; filename="$filename" Content-Transfer-Encoding: base64 $teh_globals --$boundary-- END; mail( 'webmaster@example.com', $subject, $message, $headers ); } ?> ---- Server IP: 83.138.144.80 Probable Submitter: 62.252.0.4 (proxied: 82.27.241.104) ---- Manual Page -- http://www.php.net/manual/en/ref.mail.php Edit -- https://master.php.net/note/edit/72836 Del: integrated -- https://master.php.net/note/delete/72836/integrated Del: useless -- https://master.php.net/note/delete/72836/useless Del: bad code -- https://master.php.net/note/delete/72836/bad+code Del: spam -- https://master.php.net/note/delete/72836/spam Del: non-english -- https://master.php.net/note/delete/72836/non-english Del: in docs -- https://master.php.net/note/delete/72836/in+docs Del: other reasons-- https://master.php.net/note/delete/72836 Reject -- https://master.php.net/note/reject/72836 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#122569) next »