http://www.jaggednighttheatre.com/admin/newsletter.php
In my code I want the text/html contained within the textarea to be emailed to recipients. I can email text, buttons, textboxes but not the <img> tag. For some reason that doesn't go through. Anyone know why? Here's my code:
- Code: Select all
<?php
session_start();
require_once('../mysqli_connect.php');
if(isset($_POST['submitted']))
{
$title = mysqli_real_escape_string($dbc, trim($_POST['title']));
$date = trim($_POST['date']);
$body = $_POST['body'];
$letter = '';
$letter = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
$letter .= '<html xmlns="http://www.w3.org/1999/xhtml">';
$letter .= '<body>';
$letter .= $body;
$letter .= '</body>';
$letter .= '</html>';
$to = 'mikeglaz@yahoo.com';
$subject = 'Jagged Night Theatre';
$headers = "From: mail@jaggednighttheatre.com\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($to, $subject, $letter, $headers);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Administrator Page</title>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="editNews.js"></script>
<link href="../style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="title"><h1><img src="../JNT.jpg" /></h1>
</div>
<div id="container">
<div id="buttons">
<a href="index.php" class="button">Home</a>
<a href="news.php" class="button">Update News</a>
<a href="recipients.php" class="button">Recipients</a>
<a href="newsletter.php" class="button"><span class="currentPage">Send Newsletter</span></a>
<a href="logout.php" class="button">Logout</a>
</div>
<div class="newsletter">
<h1>Create Newsletter</h1>
<br />
<?php
if(!isset($_POST['submitted']))
{
echo '<form action="newsletter.php" method="post" class="passwordForm">';
echo '<table class="tableList">';
echo '<tr>';
echo '<td><b>Title:</b></td>';
echo '<td><input type="text" name="title" size="40" maxlength="60" /></td>';
echo '<tr>';
echo '<td><b>Date:</b></td>';
echo '<td><input type="text" name="date" size="10" maxlength="20" readonly="readonly" />';
echo ' <a href="" onclick="displayCalendar(8);">Select Date</a></td>';
echo '</tr>';
echo '</table>';
echo '<script type="text/javascript">';
echo 'var dateObject = new Date();';
echo 'var month = dateObject.getMonth() + 1;';
echo 'var dateToday = dateObject.getFullYear() + "-" + month + "-" + dateObject.getDate();';
echo 'document.forms[0].date.value = dateToday;';
echo '</script>';
echo '</br>';
echo '<textarea id="news" name="body" rows="20" cols="110"></textarea>';
echo '<div class="submit">';
echo '<input type="submit" name="submit" value="Submit" />';
echo ' <input type="button" value="Cancel" onclick="cancel()">';
echo '<input type="hidden" name="submitted" value="TRUE" />';
echo '</div>';
echo '</form>';
}?>
</div>
</div>
</div>
</body>
</html>

