##############################################################
## MOD Title: MegaMail
## MOD Author: Tassos <chatasos@psclub.gr> - Original by R. U. Serious <r.u.serious@handykoelsch.de> 
## MOD Description: This MOD relates to the Admin-Mass-Mail function.
##                  Instead of sending a single email with all recipients as BCC,
##                  it will split the mail up in several emails each with X users in
##                  the BCC-field and it will send them every Y secs. 
##                  This is to work around problems for larger boards to send mass mail.
## MOD Version: 0.9.7
##
## Installation Level: easy
## Installation Time: 5 Minutes
## Files To Edit: 1
##                includes/emailer.php (or you can use the included one)
## Included Files: 4
##                 admin/admin_megamail.php
##                 language/lang_english/lang_megamail.php
##                 language/lang_english/email/admin_send_html_email.tpl
##                 templates/subSilver/admin/megamail.tpl
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## MOD Script related:
## - When using the massmail-feature, It will take quite a while to process.
##   Do _NOT_ resubmit the form, just wait... ;) 
##
## - If you copy the emailer.php from the includes directory then you don't need to make any changes on your emailer.php
##
## phpBB related:
## - Tested with phpBB 2.0.14
##
##############################################################
## MOD History:
##
##
## 2005/04/20 - 0.9.7
## - First version by chatasos
## - Added option whether to send HTML or TEXT emails
## - Added option whether to include "To:" in every batch mail or only the first one 
##
## 2004/08/20 - 0.9.6b
## - Last release by R. U. Serious
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------------
#
copy admin/admin_megamail.php to admin/admin_megamail.php
copy language/lang_english/lang_megamail.php to language/lang_english/lang_megamail.php
copy language/lang_english/email/admin_send_html_email.tpl to language/lang_english/email/admin_send_html_email.tpl
copy templates/subSilver/admin/megamail.tpl to templates/subSilver/admin/megamail.tpl
#
#-----[ OPEN ]------------------------------------------
#
includes/emailer.php
#
#
#-----[ FIND ]------------------------------------------
#
	function send()
#
#-----[ REPLACE WITH ]------------------------------------------
#
// +MOD : MegaMail
	function send($email_format = 'text')
// -MOD : MegaMail
#
#-----[ FIND ]------------------------------------------
#
		// Build header
		$this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '')  . (($bcc != '') ? "Bcc: $bcc\n" : ''); 
#
#-----[ REPLACE WITH ]------------------------------------------
#
// +MOD : MegaMail
		if ($email_format == 'html')
		{
			// Build html header
			$this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/html; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '')  . (($bcc != '') ? "Bcc: $bcc\n" : ''); 
		}
		else
		{
			// Build text header
			$this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '')  . (($bcc != '') ? "Bcc: $bcc\n" : ''); 
		}
// -MOD : MegaMail
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM