mrdeleigh
11-29-2006, 04:52 PM
Hi
Having trouble with the below code, Its ment to send the url of the page the html is on but its not, can anyone see why?
thanks
html
<form action="somepage.php" method="post">
One Email per line<br>
<textarea name="emails"></textarea><br>
<input type="submit" name="submit" value="Send">
</form>
php
<?php
$email1 = explode("\n",$_POST['emails']);
foreach($email1 as $emailaddr){
$email = $emailaddr;
$subject = "This Is Your Subject Line";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: ".$_POST['name']." \r\n" . "X-Mailer: PHP/" . phpversion();
$message = '<p>This is your message it can have HTML in it</p>
<p><a href="'.$_SERVER['HTTP_REFERER'].'">This Site</a></p>';
$mail = mail($email, $subject, $message, $headers);
}?>
Having trouble with the below code, Its ment to send the url of the page the html is on but its not, can anyone see why?
thanks
html
<form action="somepage.php" method="post">
One Email per line<br>
<textarea name="emails"></textarea><br>
<input type="submit" name="submit" value="Send">
</form>
php
<?php
$email1 = explode("\n",$_POST['emails']);
foreach($email1 as $emailaddr){
$email = $emailaddr;
$subject = "This Is Your Subject Line";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: ".$_POST['name']." \r\n" . "X-Mailer: PHP/" . phpversion();
$message = '<p>This is your message it can have HTML in it</p>
<p><a href="'.$_SERVER['HTTP_REFERER'].'">This Site</a></p>';
$mail = mail($email, $subject, $message, $headers);
}?>