Jump to content

[SOLVED] make email display html


stealthmode666

Recommended Posts

Okay, going backwards and forwards. It displays the fields as html instead of plain text.

 

now my checkboxes don't display the answer :on but they did before and the form field for textarea shows the tag name but is not picking up what the user typed in the box.

cure one issue and create another but i'll get to that later.

$body = "Robert. You have received these contact details .com:<br /><br />"; 
$body .= "<table>";
foreach($fields as $a => $b)
{
  $body .= "<tr><th>" . $a . "</th><td>" . $_REQUEST[$a] . "</td></tr>";
}
#$Body .= "<tr>";
#$Body .= "<td width=\"200px\">Member Name</td><td width=\"400px\"> $_POST{['Member_Name']} </td>";
#$Body .= "</tr><tr>";
#$Body .= "<td>Members Contact Number</td><td> $_POST{['telephone']} </td>";
#$Body .= "</tr></table>";

 

I commented out the tags above and re-ran the form.

It displays all fields in rows which looks better than plain text so I believe the html part is working as email also displays MIME version:1.0

The table I made above for the Member_Name and telephone had no effect on the sent data.

 

 

 

Link to comment
Share on other sites

$body = "Robert. You have received these contact details .com:<br /><br />"; 
$body .= "<table>";
foreach($fields as $a => $b)
{
  $body .= "<tr><th>" . $a . "</th><td>" . $_REQUEST[$a] . "</td></tr>";
}
$Body .= "<tr>";
$Body .= "<td width=\"200px\">Member Name</td><td width=\"400px\"> {$_POST['Member_Name']} </td>";
$Body .= "</tr><tr>";
$Body .= "<td>Members Contact Number</td><td> {$_POST['telephone']} </td>";
$Body .= "</tr></table>";

You will notice I now put the {} in the right place.

All my fields in the array are displaying in html in the email, but my table above which has a couple of the form fields does nothing?

Or is it displaying as the table says and just adding all the other fields in rows underneath it.

 

The reason I ask is if I comment out the lines below

$Body .= "<tr>";
$Body .= "<td width=\"200px\">Member Name</td><td width=\"400px\"> {$_POST['Member_Name']} </td>";
$Body .= "</tr><tr>";
$Body .= "<td>Members Contact Number</td><td> {$_POST['telephone']} </td>";
$Body .= "</tr></table>";

The email is still the same as in it displays all the fields in html format with or with-out this lines of code.

Sorry to be new to .php but thanks all who are tring to help me even if I seem slow to understand.

Link to comment
Share on other sites

Okay, thanks for that, :)

it now displays the correct format of the two fields I've used as in Members Name & Members Contact Number.

 

Problem now is It displays all this under the original array of data fields.

So how do I now get my script not to display the fields in the array and only display the fields in the table.

I'm thinking I'm using two ways to display the data so do I start to delete the fields in the array as I'm using post to now show the data from the form field?

Link to comment
Share on other sites

Yes, this is what I want, I will plug away until now I have my 100 fields for the applicant working and the other 100 fields for the joint applicant making about 200 fields. I want the email to display the fields in two columns which has about 100 rows each.

 

Also the email header now has this on the end which I don't want.

me@someone.co.ukMIME-Version1.0

It's picking this up from the header but how do I code it not to add it to the Email header?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.