My code so far:

$message = '<html>
                    <head>
                        <title><?php echo $subject; ?></title>
                    </head>
                    <body>
                    <?php

                        echo \'<table align="center" cellspacing="3" cellpadding="3" width="100">
                                <tr>
                                    <th align="left"><b>Player Name<b></td>
                                    <th align="left"><b>Number of Goals<b></td>
                                </tr>\';

                        while($row_GetCurMonthPlayerGoals = mysql_fetch_assoc($GetCurMonthPlayerGoals))
                        {
                            echo \'<tr>
                                    <td align="left">\' .$row_GetCurMonthPlayerGoals[\'FRName\']. \'</td>
                                    <td align="left">\' .$row_GetCurMonthPlayerrGoals[\'Sales\']. \'</td>
                                  </tr>\';
                        }

                        // Close the table:
                        echo \'</table>\';

                    ?>
                    </body>
                    </html>';

The email is sending but it is sending a blank message.

I am using the headers;

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

Have I used the escape character incorrectly maybe?

Thanks

Most of the message is being echo'ed out not appended to the message var - plus theres back slashes around all the quotes

$message = '<html>
                    <head>
                        <title>'.$subject.'</title>
                    </head>
                    <body>
                    <table align="center" cellspacing="3" cellpadding="3" width="100">
                                <tr>
                                    <th align="left"><b>Player Name<b></td>
                                    <th align="left"><b>Number of Goals<b></td>
                                </tr>';

                        while($row_GetCurMonthPlayerGoals = mysql_fetch_assoc($GetCurMonthPlayerGoals))
                        {
                           $message .= '<tr>
                                    <td align="left">' .$row_GetCurMonthPlayerGoals['FRName'].'</td>
                                    <td align="left">' .$row_GetCurMonthPlayerrGoals['Sales'].'</td>
                                  </tr>';
                        }
                        // Close the table:
                        $message .= '</table>
                    </body>
                    </html>';

You are quoting PHP code in a string instead of executing it.

Great. Cheers guys.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.