Chris Baxter wrote:
> Hi,
>
> I am trying to send the results of a form to my email account and am
> having difficulty carrying the form variable through if I use an html
> mime type.
>
> Basically, if I send the form using a plain text format, the form
> results are sucessfully copied to the email, however, if I change to
> mime type to HTML (becuase I want to include a company logo and make
> the form a little easier to read by using tabulation and bold text),
> I only seem to get the HTML, not the php variables that carry the
> from info.
>
> Below is an example of the script for the body of the email, which I
> am then sending using the mail() function:
>
> $body = <html>
> <body>
> <table width="85%" border="0" align="center">
> <tr>
> <td width=50%>Applicant 1 Forename:</td>
> <td> <? $App_1_Forename; ?></td>
> </tr>
> <tr>
> <td>Applicant 1 Surname:</td>
> <td> <? $App_1_Surname; ?></td>
> </tr>
> <tr>
> <td>Applicant 2 Forename:</td>
> <td> <? echo $App_2_Forename; ?></td>
> </tr>
> <tr>
> <td>Applicant 2 Surname: </td>
> <td> <? echo $App_2_Surname; ?></td>
> </tr>
> </table>
> </body>
> </html>;
hi chris,
okay, you try to put your html-code into a string '$body', which will be
used by mail().
but, did you look at $body before sending? i'm afraid your vars are already
missing here?
maybe you have to change your code to this:
<?php
$body = '<html>
<body>
<table width="85%" border="0" align="center">
<tr>
<td width="50%">Applicant 1 Forename:</td>
<td>' . $App_1_Forename . '</td> ...';
?>
or this:
<?php
$body = "<html>
<body>
<table width=\"85%\" border=\"0\" align=\"center\">
<tr>
<td width=\"50%\">Applicant 1 Forename:</td>
<td>$App_1_Forename</td> ...";
?>
look at the quotes. which style you want to use depends on you (i prefer the
1st)
ciao SVEN
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php