title: How do I input php variables in html mail
body: <p>Hi there I'm trying to send an HTML email through a PHP webform. The form works fine and if I pass the variables such as $name, $address in to the message it goes through ok, but when I try to format it using HTML I can't seem to get those variables passed into the message. This is an example code I found on w3schools but I can't seem to adjust it to do what I want:</p>
  
  <pre><code>&lt;?php
  ....
  $to = "somebody@example.com, somebodyelse@example.com";
  $subject = "HTML email";
  
  $message = "
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;HTML email&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p&gt;This email contains HTML Tags!&lt;/p&gt;
  &lt;table&gt;
  &lt;tr&gt;
  &lt;th&gt;Firstname&lt;/th&gt;
  &lt;th&gt;Lastname&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;John&lt;/td&gt;
  &lt;td&gt;Doe&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  ";
   ....
  ?&gt;
  </code></pre>
  
  <p>What I'm trying to do is pass the variable $name where it says "john doe", and I guess once I figure that out I should be able to pass through all my other variables as well.</p>
  
  <p>Thanks in advance for all your help.</p>