I am creating a mailer the issue I am having is that the header is separating the subject and body in to two emails. any help would be greatly appreciated.
<?php
if (isset($_POST))
$postArray = &$_POST;
else
$postArray = &$HTTP_POST_VARS;
foreach ($postArray as $sForm => $value) {
if (get_magic_quotes_gpc ())
$postedValue = ( $value );
else
$postedValue = ( $value );
?>
<?php echo $sForm ?>
$connection = @mysql_connect($host, $username, $password) or die("could not connect");
$db = @mysql_select_db($dbname, $connection) or die("bd");
$sql = "SELECT email FROM $T1";
$res = @mysql_query($sql, $connection) or die("could not get address");
$headers = "from \"your mailing lise\"\n";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
while ($row = mysql_fetch_array($res)) {
$email = $row['email'];
mail($email,$postedValue, $headers);
echo "newsletter sent to $email<br>";
}
?>
Question
ironsight2000
I am creating a mailer the issue I am having is that the header is separating the subject and body in to two emails. any help would be greatly appreciated.
<?php if (isset($_POST)) $postArray = &$_POST; else $postArray = &$HTTP_POST_VARS; foreach ($postArray as $sForm => $value) { if (get_magic_quotes_gpc ()) $postedValue = ( $value ); else $postedValue = ( $value ); ?> <?php echo $sForm ?> $connection = @mysql_connect($host, $username, $password) or die("could not connect"); $db = @mysql_select_db($dbname, $connection) or die("bd"); $sql = "SELECT email FROM $T1"; $res = @mysql_query($sql, $connection) or die("could not get address"); $headers = "from \"your mailing lise\"\n"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; while ($row = mysql_fetch_array($res)) { $email = $row['email']; mail($email,$postedValue, $headers); echo "newsletter sent to $email<br>"; } ?>Link to comment
Share on other sites
4 answers to this question
Recommended Posts