Location: PHPKode > scripts > No Timeout > no-timeout/scripts/emailSend.php
<?php
header('Content-type: text/html; charset=iso-8859-1');
set_time_limit (2);
require_once '../class/class.noTimeOut.php';
if (isset ($_POST['iStart'])) {
	$oNTM = new noTimeOut;
	$oNTM -> TYPE = 'FILE_LINE';
	$oNTM -> FILE = $_POST['sFile'];
	$oNTM -> START = $_POST['iStart'];
	$oNTM -> STEP = $_POST['iStep'];
	$sChaine = $oNTM -> flushMe ();
	$sSubject = 'Test Flusher';
	$sHeaders = 'From: hide@address.com' . "\n" .
	'Reply-To: hide@address.com' . "\n" .
	'X-Mailer: PHP/' . phpversion()."\n".
	'MIME-Version: 1.0' . "\n".
	'Content-type: text/html; charset=iso-8859-1' . "\n".
	'Content-Transfer-Encoding: 8bit'."\n\n";
	$sMessage = <<<HTML
	Hi,<br /><br />
	this is a spam test ;-)
	<br /><br />
	Beware!!
HTML;
	try {
		if (false === @mail ($sChaine, $sSubject, $sMessage, $sHeaders)) {
			throw new Exception ('Failed! | ');
		}
		echo 'Email envoyé : ', $sChaine, ' | ';
	} catch (Exception $e) {
		echo $e -> getMessage ();
	}
}
?>
Return current item: No Timeout