Har følgende kode:
<?
if($_POST[submit_send] And strlen($_POST[message]) > 0)
{
// Send email
// hvis sendt og arkiveret, skriv bekræftelse
$query = "SELECT address FROM mailinglist_subscribers WHERE confirmed = '1'";
$result = mysql_query($query) or die("Forespørgsel fejlede : " . mysql_error());
$sent_count = mysql_num_rows($result);
$bcc = "";
while ($row = mysql_fetch_assoc($result))
{
$bcc .= "$row[address],";
}
$subscribers = substr($bcc, 0, -1);
$to = $owner_email;
// $message = wordwrap($message, $columns, "\n");
$sent_date = time();
if ($_POST[format] == 1)
{
$texthtml = "html";
}
else
{
$texthtml = "text";
}
$message = addslashes($message);
$query = "INSERT INTO mailinglist_messages (subject,message,created,queued,count,format) VALUES ('$subject','$message','$sent_date','$utime','$sent_count','$texthtml')";
$result = mysql_query($query) or die("Forespørgsel fejlede : " . mysql_error());
$message_id = mysql_insert_id();
if (isset($queue_size))
{
$address_query = "SELECT address FROM mailinglist_subscribers WHERE confirmed = '1'";
$address_result = mysql_query($address_query) or die("Forespørgsel fejlede : " . mysql_error());
while ($address_row = mysql_fetch_assoc($address_result))
{
$queue_insert_query = "INSERT INTO mailinglist_queue (message_id,address,send_after) VALUES ('$message_id','$address_row[address]','$utime')";
$queue_insert_result = mysql_query($queue_insert_query) or die("Forespørgsel fejlede : " . mysql_error());
}
echo "<p><span class=\"groen\">Beskeden er sat i kø til forsendelse og arkiveret.</span> Du kan se forsendelses-processen i <a href=archives.php>Arkiverne</a>.</p>";
}
else
{
$message = stripslashes($message);
$message .= "\n\n\n\nDu har modtaget dette nyhedsbrev, fordi din email-adresse er tilmeldt $list_name.";
$message .= " For at afmelde, følg venligst dette link: $unsub_url";
if ($_POST[format] == 1)
{
$boundary = md5(uniqid(time()));
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: multipart/alternative;\r\n";
$headers .= " boundary=\"$boundary\"\r\n";
$send_message = "Du burde aldrig se dette!\r\n\r\n";
$send_message .= "--$boundary\r\n";
$send_message .= "Content-type: text/plain;\r\n";
$send_message .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$send_message .= strip_tags($message) . "\r\n";
$send_message .= "--$boundary\r\n";
$send_message .= "Content-type: text/html;\r\n";
$send_message .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$send_message .= $message . "\r\n";
$send_message .= "--$boundary--\r\n";
}
else
{
$send_message = $message;
}
$headers .= "From: $owner_email\r\nSvar to: $owner_email\r\nBcc: $subscribers\r\n";
if(mail($to, $subject, $send_message, $headers))
{
echo "<p><span class=\"groen\">Beskeden er sendt og arkiveret.</span> Du kan se beskeden i <a href=archives.php>Arkiverne</a>.</p>";
}
else
{
echo "<p class=\"roed\">Ikke muligt at sende besked. Tjek din server's fejl-log for detaljer.</p>";
}
}
}
?>
Hvor skal det ind det du har skrevet?
Kan ikke lige gennemskue det...