Zipped backup attachment within email body?

Post your support requests/solutions for phpMySQLAutoBackup [website]
davidgwalker
MODS thats what I do that is! But definately NO mod music! It has to be ROCK!
Posts: 1809
Joined: Mon Oct 25, 2004 8:20 pm
Location: Huddersfield, UK
Contact:

Zipped backup attachment within email body?

Postby davidgwalker » Thu Oct 23, 2008 1:37 pm

If you are experiencing a reported issue with the zipped backup attachment appearing within email body then please try the following...

Edit the file:
\files\phpmysqlautobackup_extras.php
and reply all code with:

Code: Select all

<?php
/**********************************************************
 *               phpMySQLAutoBackup                       *
 *           Author:  http://www.DWalker.co.uk            *
 *            Now released under GPL License              *
 *                                                        *
 **********************************************************
 *     Version    Date              Comment               *
 *     0.2.0      7th July 2005     GPL release           *
 *     0.3.0      19th June 2006  Upgrade                 *
 *           - added ability to backup separate tables    *
 *     0.4.0      Dec 2006   removed bugs/improved code   *
 *     1.4.0      Dec 2007   improved faster version      *
 *     1.4.2    July 2008 modified to overcome issue with *
 *                       "double newline in headers"      *
 *     1.4.3    Oct 2008 mod header - \r\n changed to \n  *
 **********************************************************/
$phpMySQLAutoBackup_version="1.4.3";
// ---------------------------------------------------------
// For support and help please try the forum at: http://www.dwalker.co.uk/forum/

function has_data($value)
{
 if (is_array($value)) return (sizeof($value) > 0)? true : false;
 else return (($value != '') && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) ? true : false;
}

function xmail ($to_emailaddress,$from_emailaddress, $subject, $content, $file_name, $backup_type)
{
 $mail_attached = "";
 $boundary = "----=_NextPart_000_01FB_010".md5($to_emailaddress);
 $mail_attached.="--".$boundary."\n"
                       ."Content-Type: application/octet-stream;\n name=\"$file_name\"\n"
                       ."Content-Transfer-Encoding: base64\n"
                       ."Content-Disposition: attachment;\n filename=\"$file_name\"\n\n"
                       .chunk_split(base64_encode($content))."\n";
 $mail_attached .= "--".$boundary."--\r\n";
 $add_header ="MIME-Version: 1.0\nContent-Type: multipart/mixed;\n        boundary=\"$boundary\" \n";
 $mail_content="--".$boundary."\n"."Content-Type: text/plain; \n charset=\"iso-8859-1\"\n"."Content-Transfer-Encoding: 7bit\r\n\r\nBACKUP Successful...\r\n\r\nPlease see attached for your zipped Backup file; $backup_type \r\nIf this is the first backup then you should test it restores correctly to a test server.\r\n\r\n phpMySQLAutoBackup is developed by http://www.dwalker.co.uk/ \r\n\r\n Have a good day now you have a backup of your MySQL db  :-) \r\n\r\nPlease consider making a donation at: \r\n http://www.dwalker.co.uk/make_a_donation.php \r\n (any amount is gratefully received)\r\n".$mail_attached;
 return mail($to_emailaddress, $subject, $mail_content, "From: $from_emailaddress"."\n"."Reply-To:$from_emailaddress"."\n".$add_header);
}

function write_backup($gzdata, $backup_file_name)
{
 $fp = fopen(LOCATION."../backups/".$backup_file_name, "w");
 fwrite($fp, $gzdata);
 fclose($fp);
 //check folder is protected - stop HTTP access
 if (!file_exists(".htaccess"))
 {
  $fp = fopen(LOCATION."../backups/.htaccess", "w");
  fwrite($fp, "deny from all");
  fclose($fp);
 }
}
?>

Return to “phpMySQLAutoBackup [forum]”

Who is online

Users browsing this forum: No registered users and 2 guests