Jump to content

Weaird email..


DeathStar

Recommended Posts

Hi there.

I'm making a newsletter script and cant figure this thing out!

Its displaying as text not html!

Here is my script:

<?php 

session_start(); 
require "global_func.php"; 
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } 
$userid=$_SESSION['userid']; 
require "header.php"; 
$h = new headers; 
$h->startheaders(); 
include "mysql.php"; 
global $c; 
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); 
$ir=mysql_fetch_array($is); 
check_level(); 
$fm=money_formatter($ir['money']); 
$cm=money_formatter($ir['crystals'],''); 
$lv=date('F j, Y, g:i a',$ir['laston']); 
$h->userdata($ir,$lv,$fm,$cm); 
$h->menuarea(); 
if($userid != 1) 
{ 
die("You are not the owner");exit; 
} 
if($_POST['mes']) 
{ 
$ax=mysql_query("SELECT * FROM users",$c); 
while($r=mysql_fetch_array($ax)) 
{ 

$to = $r['email'];
$subj = "News from Domain.com";
$mess = $_POST['mes'];   
$headers = "Content-type: text/html; charset=iso-8859-1\r\n"; 
$headers ="From: [email protected]\r\n"; 
mail($to,$subj,$mess,$headers); 
echo "<h2><b>Sent! to {$r['username']}..</b></h2>";
} 
print "Newsletter sent to ".mysql_num_rows($ax)." Users"; 
} 
else 
{ 
print "Send Newsletter to everyone!!.<br /> 
<form action='nletter.php' method='post'> 
<textarea cols=30 rows=15 name='mes'> 
</textarea> 
<input type='submit' value='Send!'></form>"; 
} 
$h->endpage(); 
?>

Link to comment
https://forums.phpfreaks.com/topic/44560-weaird-email/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.