wrefai Posted June 5, 2006 Share Posted June 5, 2006 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 allmembers</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> </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 Quote Link to comment https://forums.phpfreaks.com/topic/11220-enable-html-on-email-all-members/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.