Re: mail() php in message

From: Date: Sun, 12 Oct 2003 18:37:03 +0000
Subject: Re: mail() php in message
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-165916@lists.php.net to get a copy of this message
Hallo Onno, am Sonntag, 12. Oktober 2003 um 20:07 hast Du Folgendes gekritzelt: OK> Hi, OK> is there a way to create a mail (with the mail() function) that contains OK> php in the message. OK> Like: OK> <?php OK> $to = "user@domain.com"; OK> $subject = "a subject"; OK> $message = ???? OK> I WANT TO PUT SOME PHP IN HERE TO CREATE A TABLE IN THE MESSAGE: OK> $columnbooks = mysql_list_fields($dbname,tmp,$mysql_link); OK> $sqlbooks = "select isbn,books.title, writer, publisher from tmp,books OK> where tmp.user=books.user"; OK> $resultbooks = mysql_db_query($dbname,$sqlbooks); ?>> OK> <table cellpadding="2" cellspacing="2" border="1" OK> style="text-align: left; width: 100%;">> OK> <?php OK> while ($valuebooks = mysql_fetch_array($resultbooks)) OK> { print "<tr bgcolor=#ccf504>"; OK> for($i=0; $i< 4; $i++ ) OK> { OK> $gebruikerbooks=$valuebooks[$i]; OK> print "<td> $gebruikerbooks </td>"; OK> } OK> print "</tr>"; OK> } OK> mysql_free_result($resultbooks); OK> THIS SHOULD BE THE END OF THE MESSAGE OK> HERE I WILL DO THE MAILING OK> mail($to,$subject,$message); ?>> You should know that php runs on a server, not on the client machine. So what do you want to do with php-code in a mail? You could put html (generated by php for example), so that the mail-reader can display a table. SvT -- Who is the ennemy? mailto:elektrik@gmx.net

« previous php.general (#165916) next »