这是从'.$smtp["site"].'由Typecho AutoBackup插件自动发送的数据库备份文件,备份文件详见邮件附件!
plugin('AutoBackup'); $current = Typecho_Date::gmtTime(); //当前时间 $config_file = dirname(__FILE__).'/config.xml'; $xml = simplexml_load_file($config_file); $lasttime = intval($xml->lasttime); if($type==0){ if ($lasttime < 0 || ($current - $lasttime) < $configs->circle * 24 * 60 * 60) { return $contents; } } $file_path = self::create_sql(); //获取备份语句 $xml->lasttime = time(); $xml = $xml->asXML(); $fp = fopen($config_file, 'wb'); fwrite($fp, $xml); fclose($fp); //将备份文件发送至设置的邮箱 $smtp = array(); $smtp['site'] = $options->title; $smtp['attach'] = $file_path; $smtp['attach_name'] = "AutoBackup".date("Ymd", $current).".zip"; if (!function_exists('gzopen')) { $smtp['attach_name'] = "AutoBackup".date("Ymd", $current).".sql"; } //获取SMTP设置 $smtp['user'] = $configs->user; $smtp['pass'] = $configs->pass; $smtp['host'] = $configs->host; $smtp['port'] = $configs->port; $format = "format"; if ($configs->subject != "") { $smtp['subject'] = date("Ymd").'-'.$configs->subject.'-数据库备份文件'; }else { $smtp['subject'] = date("Ymd").'-'.$options->title.'-数据库备份文件'; } $smtp['AltBody'] = ""; $smtp['body'] = '
这是从'.$smtp["site"].'由Typecho AutoBackup插件自动发送的数据库备份文件,备份文件详见邮件附件!
该邮件由您的Typecho博客'.$smtp["site"].'使用的插件AutoBackup发出
如果你没有做相关设置,请联系邮件来源地址'.$smtp["user"].'