Jump to content

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/11220-enable-html-on-email-all-members/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.