Problem with mail()

From: Date: Sat, 29 Sep 2001 13:47:53 +0000
Subject: Problem with mail()
Groups: php.general 
Request: Send a blank email to php-general+get-69290@lists.php.net to get a copy of this message
I am using this simple script: ?PHP global $id, $subject, $news; $database="yisny"; include ("yisny_db.inc"); db_connect ($database); print ("$id"); $query = "select news_id, summary, news from news where news_id=$id"; $result = mysql_query ($query)
      or die ("sorry"); 
$row = mysql_fetch_array ($result); $news =strip_tags(stripslashes($row["news"])); $subject= strip_tags(stripslashes($row["summary"])); $to = "mike@raeinternet.com"; mail($to,$subject,$news, "From: yis <yir@raeinternet.com>"); print ("<a href=/yisny/whatsnew.php>See Events</a>"); ?> Problem is that the from: header ends up in the body of the message. If I change $subject to "subject" (no variable) and $news to "news", headers are fine. I used to pass the variables between multiple html forms as globals and hidden fields and I had no problems until the size of $message became too large. When it grew above 7kb or so the subject header would disappear. At this point I would like to use the above script and have the from: header appear as a header and not in the message body. Running Linux and PHP4.05 MySql field type of news is blob. Any input is appreciated. Thanks, MK

« previous php.general (#69290) next »