Location: PHPKode > projects > Content*Builder > modules/article2/mail-article.php
<?
    /* vim: set expandtab tabstop=4 shiftwidth=4: */
	// +----------------------------------------------------------------------+
	// | Netbuilder 2.0beta - overview-template #2						    |
	// +----------------------------------------------------------------------+
	// | Copyright (c) 2001, Stefan Ernst								     |
	// +----------------------------------------------------------------------+
	// | Author: Stefan Ernst <hide@address.com>				      |
	// +----------------------------------------------------------------------+
	//		 last modified: 04.09.2001

	/*
	Notes:
	Warning! This template will not work, if you
	delete or move the libraries/-directory.
	If you still want to do it:
	change the library-path to the current location!
	*/

	foreach($HTTP_POST_VARS as $k => $value) {
		${$k} = $value;
	}
	$rel = "../../";
	include($rel."prepend.php");
	include($rel."libraries/BTPL_functions.inc.php");
	
	$path["link-template"] = "index.php"; # path to the article-display-template

	$sitename = "Enter your sitename here!";
	$yourtext = "Enter a text for the person who gets the email!";

	$result = mysql_fetch_object(mysql_query("SELECT * FROM ".TABLE."_article WHERE ide = '$id'"));
	
	if(isset($mail)) {
		$intro = ereg_replace("<br>","\n",$result->intro);
		$intro = ereg_replace("<p>","\n\n",$intro);
		$content = ereg_replace("<br>","\n",$result->content);
		$content = ereg_replace("<p>","\n\n",$content);
		$title = strip_tags($$result->title);
		$intro = strip_tags($intro);
		$content = strip_tags($content);

		$mailtext = $title."\n \n";
		$mailtext .= $intro."\n \n";
		$mailtext .= $content." || Date: ".getGermanDate($result->datum)."\n \n";

		$mail_s = mail($to,$sitename.": ".$title,
		$yourtext."\n\n".$message."\n\n".$mailtext,
		"From: $ownaddress\nReply-To: $ownaddress\nX-Mailer: Netbuilder Newssystem 2.0beta");
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
		<title>
		Mail Article Template
		</title>
		<style type="text/css">
		<!--
				.row {
						font-size: 11px;
						font-family: Tahoma;
						letter-spacing: 1px;
						line-height: 14px;
				}
				.header
				{
						background : transparent;
						color : #3F6A95;
						font : bold 13pt Tahoma, Verdana;
						letter-spacing : 1px;
				}
				hr
				{
						color : #000000;
						background : transparent;
						width : 100%;
						height : 1px;
				}
		//-->
		</style>
</head>
<body bgcolor="#FFFFFF">
<table width="600" align="center">
	<tr>
		<td>
		<div class="header">
		Article-Mail
		</div>
		</td>
	</tr>
	<tr>
		<td class="row">
		<form action="<? echo $PHP_SELF; ?>" method="POST">
		<input type="hidden" name="id" value="<? echo $id; ?>">
		From: <input type="text" name="ownaddress" class="row" value="Your email address"><br>
		To:<input type="text" name="to" class="row"><p>
		<textarea name="message" class="row" cols="30" rows="4">Your Message</textarea>
		<input type="submit" name="mail">
		</form>
		<?
			if(isset($mail_s)) {
				echo "Mail sent successfully!";
			}
		?>
		</td>
	</tr>
</table>
</body>
</html>
Return current item: Content*Builder