note 17740 added to function.mail

From: Date: Fri, 21 Dec 2001 15:31:52 +0000
Subject: note 17740 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-23754@lists.php.net to get a copy of this message
You can add PHP variables to your mail message, to give your mail that truly dynamic look. Through much trial and error, I found that you can't throw the variable directly in with your message text. Here's how you do it: $message=mysql_query("select * from content where issue='$issue' order by priority asc"); $num_rows=mysql_num_rows($message); for($i=0; $i<$num_rows; $i++) { $row=mysql_fetch_array($message); $mail_stories .= ' <P> <b>'; $mail_stories .= $row["title"]; $mail_stories .= ' </b><br> '; $mail_stories .= $row["summary"]; $mail_stories .= '<p>'; } $final_message=stripslashes($intro).$mail_stories; -- http://www.php.net/manual/en/function.mail.php http://master.php.net/manage/user-notes.php?action=edit+17740 http://master.php.net/manage/user-notes.php?action=delete+17740 http://master.php.net/manage/user-notes.php?action=reject+17740

« previous php.notes (#23754) next »