this worked for me but i did some editing and censoring oso maybe a tiny bug got in.



///SETUP strings
$subject='hi there, this is not a Viagra business proposal, ';
$mailto = '[EMAIL PROTECTED],[EMAIL PROTECTED]';// for multiple recipients, use comma '[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]'
$From = '"Your website'" <[EMAIL PROTECTED]>'; // gets shown as mail sender. can be anything.
$message = "\nThis is a backup created by a script on your site. \nThe location of the script is ".__FILE__.'.';
$filedata = getyourcontentsomehow();
//create a filename for the email. the date and time at the start of the filename make it easy to sort it.
$filename = date("Y_m_d__H_i").'anytext'.".sql";



//prepare mail body
$filedata = chunk_split(base64_encode($filedata));
$type = "application/octet-stream";
$encoding = "base64";
mt_srand((double)microtime()*1000000);
$boundary = '--b'.md5(uniqid(mt_rand())) . getmypid(); //as long as it starts with -- it should work
$mailbody = "From: Your website script\n"
."MIME-Version: 1.0\n"
."Content-Type: multipart/mixed; boundary=\"$boundary\"\n\n"
."This is a MIME encoded message. \n\n"
."--$boundary\n"
."Content-Type: text/plain\n";
."Content-Transfer-Encoding: 8bit\n\n"
.$message . "\n\n\n--$boundary";
$data = "Content-Type: $type"."; name = \"$filename\"\n"
."Content-Transfer-Encoding: $encoding"
."\n\n$filedata\n";
$mailbody .= "\n$data\n--$boundary"
."--\n";


//send mail
mail($mailto, $subject , ' ', $mailbody) or die ('Could not send email!');


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to