Location: PHPKode > projects > Laikwan WMC > wmc_20070325/imap/send.php
<?


header("Content-type: text/html; charset=utf-8");
header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

@ini_set("session.use_cookies",	 0);
@ini_set("session.use_trans_sid", 1);					 
session_start();

flush();

$server = $_SESSION['imap']['server'] ;
$user = $_SESSION['imap']['user'] ;
$pass = $_SESSION['imap']['pass'] ;

echo "<html>";
echo "<script>";

// successful
if (isset($server) && isset($user) && isset($pass)){

	$mbox = imap_open("{".$server."}", $user, $pass);
	//imap_mail ( string to, string subject, string message [, string additional_headers [, string cc [, string bcc [, string rpath]]]] )
	$success = imap_mail( $_POST['to'], $_POST['subj'], $_POST['body'], '' , $_POST['cc'],  $_POST['bcc']);

	if ($success){
		echo "top.COMPOSE.composeTargetIframeLoaded(true,'','" . $_POST['send'] . "');";
	}else{
		echo "top.COMPOSE.composeTargetIframeLoaded(false, 'Email sending failed', '" . $_POST['send'] . "');";
	}

	imap_close($mbox);

}else{
	echo "top.COMPOSE.composeTargetIframeLoaded(false, 'Your login expired', '" . $_POST['send'] . "');";
}

echo "</script>";
echo "</html>";
print "<status>Your login expired</status>\n";
?>


Return current item: Laikwan WMC