Jump to content

mail (sending me two emails -- why?)


RyanSF07

Recommended Posts

Hi -- I'm receiving two emails with this code.. one from "webmaster" and another from "serveradmin."  What's odd is that the one from serveradmin contains the subject, but not the message.

 

Does anyone know why this is happening and how to fix it so I only receive one email?

 

thanks -- here's the code

 

$usercheck = $_SESSION['user_id'];
$check = mysql_query("SELECT * FROM articles WHERE art.id = '$_GET[id]' AND art.user_id = '$usercheck'")or die(mysql_error());
$check2 = mysql_num_rows($check);

$recep = "[email protected]";
$subject = "Email Subject Line";
$text = "$usercheck";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=UTF-8\r\n";
$headers .= "Reply-to: [email protected]\n";
$headers .= "X-Mailer: PHP\n";

if ($check2 != 1) {
include_once ("nav_my_account.inc");
mail("$recep","$subject","$text","$headers");
$content = "<p>You can only edit your own articles. <br><br>If you feel you're getting this message in error, it may be that your session has timed out and you need to log back in. </p>\n";

} else {

include_once ("nav_my_account.inc"); 
.....etc....

 

Link to comment
https://forums.phpfreaks.com/topic/219377-mail-sending-me-two-emails-why/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.