Jump to content


Photo

Enable HTML on email all members


  • Please log in to reply
No replies to this topic

#1 wrefai

wrefai
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 05 June 2006 - 08:17 AM

Hello please help , I have this page that I could email all members with, but I want to enable HTML to send to the members more professional emails

<?php require('config.php'); ?>
<html>
<head>
<title><?php echo $title; ?></title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css">

<script LANGUAGE="JavaScript">
function datacheck(){

if (document.sendmail.subject.value=="")
{
alert("You must type the subject");
return false;

}
if (document.sendmail.body.value=="")
{
alert("You must type the body");
return false;

}
}
</script>
</head>
<body>
<?php if (isset($_POST['subject']) && isset($_POST['body'])) {
$body = $_POST['body'];
$subject = $_POST['subject'];
$sql = mysql_query("select email from users");
$emails = array();
while($row = mysql_fetch_array($sql)) {
$emails[] = $row['email'];
}
$cont = count($emails);
for($num = 0;$num < $cont; $num++) {
$hi = $emails[$num];
$send = mail($hi,$subject,$body,"From: {$email}\r\n");
}
if (!$send) { echo "<div align='center'><p><b>the message has not been sent<br /><a href=

'email.php'>Back</a></b></div></p>"; exit();
} else {
echo "<div align='center'><p><b>the message has been sent<br /><a href='index.

php'>Back</a></b></div></p>";
}
}
?>
<div align="center">
<form method="POST" name="sendmail" action="<?php echo $_SERVER['PHP_SELF'] ?>" onSubmit="return datacheck()">

<table border="0" width="40%" id="table1" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#C0C0C0">
<div align="center">
<table border="0" width="100%" id="table2" cellspacing="1" cellpadding="4" height="132">
<tr>
<td bgcolor="#E6E6E6" align="center" height="35"><font size="5">Email all
members</font></td>
</tr>
<tr>
<td bgcolor="#E6E6E6" align="right" valign="top">
<table border="0" width="100%" id="table3" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" height="216">
<tr><td style="border: 1px solid #C0C0C0" align="center" valign="top">
<table border="0" width="100%" id="table4" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<p align="center"><b>Subject</b> :
<input type="text" name="subject" size="26" style="border: 1px solid #000000"></td>
</tr>
<tr>
<td>
<p align="center"><b>Body</b></td>
</tr>
<tr>
<td>
<p align="center">
<textarea rows="13" name="body" cols="46" style="border: 1px solid #000000"></textarea></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div></td>
</tr>
</table>
</div>

<div align="center">
<p><input type="submit" value="Send now" name="B1"></p>
</form>
<a href="index.php">Return to front page</a></div>
</body>

</html>

Thanks ! Please help




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users