Page 1 of 1

Email problem

Posted: Sun Apr 13, 2003 11:19 am
by santa
I have been trying to fix some code.
Below find my code. Thru an admin of my script I am trying to format it and also when a person gets the email not only do i want it to look right but I want the link to be clickable. If anyone can tell me what i may be missing or what is wrong please do so asap. It seems that by using <br> tags in admin to format the emails works great..But $link is just a text link and not clickable.

Thanks

Code: Select all

<?
   function MsgFromTpl($to,$subj,$tpl)
   &#123;
	global $lname,$email,$fname,$login,$pswd,$link,$ADMIN_MAIL;

	$h = fopen("$tpl","r");
	if(!$h) return;
	
	$msg = "";
	while(!feof($h))
		$msg .= fgetc($h);
	fclose($h);

	ereg_replace(""","'",$msg);
	eval("\$msg="$msg";");

	
   /* To send HTML mail, you can set the Content-type header. */
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* additional headers */
$headers .= "From: $ADMIN_MAIL\r\n";

/* and now mail it */
mail($to, $subj , $msg, $headers);
	
  &#125;

   function MsgToAdmin_UserReg($to,$subj,$tpl)
   &#123;
	global $lname, $email, $fname, $login, $pswd, $link, $ADMIN_MAIL;

	$h = fopen("$tpl","r");
	if(!$h) return;
	
	$msg = "";
	while(!feof($h))
		$msg .= fgetc($h);
	fclose($h);

	ereg_replace(""","'",$msg);
	eval("\$msg="$msg";");
	
	@mail($to,$subj,$msg,"From: $ADMIN_MAIL \r\n"."Reply-To: $email \r\n");
   &#125;	


   function MsgToAdmin_UserSignUp($to,$subj,$tpl)
   &#123;
	global $lname, $email, $fname, $login, $pswd, $link, $ADMIN_MAIL;
	global $username,$password;

	$h = fopen("$tpl","r");
	if(!$h) return;
	
	$msg = "";
	while(!feof($h))
		$msg .= fgetc($h);
	fclose($h);

	ereg_replace(""","'",$msg);
	eval("\$msg="$msg";");
	
	@mail($to,$subj,$msg,"From: $ADMIN_MAIL \r\n"."Reply-To: $ADMIN_MAIL \r\n");
	
   &#125;		
	

   function MsgToAdmin_BannDelete($to,$subj,$tpl,$url,$name)
   &#123;
	global $ADMIN_MAIL;

	$h = fopen("$tpl","r");
	if(!$h) return;
	
	$msg = "";
	while(!feof($h))
		$msg .= fgetc($h);
	fclose($h);

	ereg_replace(""","'",$msg);
	eval("\$msg="$msg";");

	@mail($to,$subj,$msg,"From: $ADMIN_MAIL \r\n"."Reply-To: $ADMIN_MAIL \r\n");
   &#125;		



   function MsgToAdmin_CampAdd($to,$subj,$tpl,$url)
   &#123;
	global $ADMIN_MAIL;

	$h = fopen("$tpl","r");
	if(!$h) return;
	
	$msg = "";
	while(!feof($h))
		$msg .= fgetc($h);
	fclose($h);

	ereg_replace(""","'",$msg);
	eval("\$msg="$msg";");

	@mail($to,$subj,$msg,"From: $ADMIN_MAIL \r\n"."Reply-To: $ADMIN_MAIL \r\n");
   &#125;	




  function MsgToUser_CampAppr($to,$subj,$tpl,$url,$name)
   &#123;
	global $ADMIN_MAIL;

	$h = fopen("$tpl","r");
	if(!$h) return;
	
	$msg = "";
	while(!feof($h))
		$msg .= fgetc($h);
	fclose($h);

	ereg_replace(""","'",$msg);
	eval("\$msg="$msg";");
	@mail($to,$subj,$msg,"From: $ADMIN_MAIL \r\n"."Reply-To: $ADMIN_MAIL \r\n");
	//echo "mail sent to user";
   &#125;		


  function MsgToUser_CampDrop($to,$subj,$tpl,$url,$name)
   &#123;
	global $ADMIN_MAIL;

	$h = fopen("$tpl","r");
	if(!$h) return;
	
	$msg = "";
	while(!feof($h))
		$msg .= fgetc($h);
	fclose($h);

	ereg_replace(""","'",$msg);
	eval("\$msg="$msg";");

	@mail($to,$subj,$msg,"From: $ADMIN_MAIL \r\n"."Reply-To: $ADMIN_MAIL \r\n");
   &#125;		 	


  function MsgToAdmin_BannAdd($to,$subj,$tpl,$url)
   &#123;
	global $ADMIN_MAIL;

	$h = fopen("$tpl","r");
	if(!$h) return;
	
	$msg = "";
	while(!feof($h))
		$msg .= fgetc($h);
	fclose($h);

	ereg_replace(""","'",$msg);
	eval("\$msg="$msg";");

	@mail($to,$subj,$msg,"From: $ADMIN_MAIL \r\n"."Reply-To: $ADMIN_MAIL \r\n");
   &#125;	
	

  function MsgToUser_BannDrop($to,$subj,$tpl,$url,$name)
   &#123;
	global $ADMIN_MAIL;

	$h = fopen("$tpl","r");
	if(!$h) return;
	
	$msg = "";
	while(!feof($h))
		$msg .= fgetc($h);
	fclose($h);

	ereg_replace(""","'",$msg);
	eval("\$msg="$msg";");

	@mail($to,$subj,$msg,"From: $ADMIN_MAIL \r\n"."Reply-To: $ADMIN_MAIL \r\n");
   &#125;		



   function MsgToUser_LowCredit($to,$subj,$fname,$url,$tpl)
   &#123;
	global $ADMIN_MAIL;

	$h = fopen("$tpl","r");
	if(!$h) return;
	
	$msg = "";
	while(!feof($h))
		$msg .= fgetc($h);
	fclose($h);

	ereg_replace(""","'",$msg);
	eval("\$msg="$msg";");

	@mail($to,$subj,$msg,"From: $ADMIN_MAIL \r\n"."Reply-To: $ADMIN_MAIL \r\n");
   &#125;			


   function MsgToUser_BannAppr($to,$subj,$tpl,$url,$name)
   &#123;
	global $ADMIN_MAIL;

	$h = fopen("$tpl","r");
	if(!$h) return;
	
	$msg = "";
	while(!feof($h))
		$msg .= fgetc($h);
	fclose($h);

	ereg_replace(""","'",$msg);
	eval("\$msg="$msg";");

	@mail($to,$subj,$msg,"From: $ADMIN_MAIL \r\n"."Reply-To: $ADMIN_MAIL \r\n");
   &#125;			
	

?>

Posted: Sun Apr 13, 2003 2:45 pm
by volka
can't find any usage of $link (other than declaring it as global) so I stopped reading ;)
please give more details.