note 46362 added to function.mail
| From: | hans at twisted dot nl | Date: | Fri, 08 Oct 2004 08:29:07 +0000 |
| Subject: | note 46362 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78174@lists.php.net to get a copy of this message | ||
Hye there,
I'm trying to create a semi-dynamic email newsletter
I'm using the sendmail function and use a database connection to include my contacts
email-adresses without having to fill them out manually.
*PROBLEM: i receive every mail TWICE in my outlookBox, as if I would push the submit button twice
everytime, which isn't!
For the complete operation I use 3 files namely:
1) a basic form to create my message.
2) a db connect file to my email-address table (included after submit'n the form)
3) last but not least the include file ' send_mymail.php' with all my vars. the code i
use in this file stands below!
+++++++++++++++++++++++++++++++++++++++++++
<?php
$sql = "SELECT * FROM email_db";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result) or die(mysql_error());
$to = $row["email"];
$subject = "Something interesting\n";
$headers = "From: Twisted Crew\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=us-ascii\n";
$inhoud = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<title>Nieuwsbrief Laurentius</title>
<meta http-equiv=\"Content-Type\" content=\"text/html;
charset=iso-8859-1\">
</head>
<body>
etc...
</body>
</html>";
?>
++++++++++++++++++++++++++++++++++++++++++++
Can anyone help?
I tried all kinds off different changes but didn't found the sollution yet.
on occasion it will send it once without changing the code????? but thats very rare!
TNX
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46362
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46362&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46362&report=yes
Search -- http://master.php.net/manage/user-notes.php