title: outlook mail window with pre populated to sender box not working
body: <p><a href="https://i.stack.imgur.com/3O1bd.png" rel="nofollow noreferrer">errors i get</a></p>
  
  <p>I have a table that contains details one of this being emails. When i click a link i have outlook mail opening but i want to take the email of that row in the table and put it into the 'to' part of the email. Below i have code for what i am currently doing. </p>
  
  <p>the code below displays the data from my database in a table format 
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;table class="table table-striped custab"&gt;
             &lt;thead&gt;
              &lt;tr&gt;
              &lt;th&gt; &lt;/th&gt;
              &lt;th&gt;Booking ID&lt;/th&gt;
       &lt;th&gt; Name&lt;/th&gt;
              &lt;th&gt;Email&lt;/th&gt;
       &lt;th&gt;Date&lt;/th&gt;
       &lt;th&gt;time&lt;/th&gt;
       &lt;th&gt;No. of guests&lt;/th&gt;
              &lt;th&gt;Booking Reason&lt;/th&gt;
              &lt;th&gt;Comments&lt;/th&gt;
       &lt;th width="110" class="ac"&gt;Approved?&lt;/th&gt;
       &lt;/tr&gt; 
             &lt;thead&gt;
               &lt;!-- php function to only select the bookings that have not yet been approved/rejected --&gt;
               &lt;?php
    include 'config.php';
    $select = "SELECT * FROM `booking` WHERE `status`IS NULL ";
    $result = $conn-&gt;query($select);
    while($row = $result-&gt;fetch_assoc()){
        ?&gt;
              &lt;tr&gt;
    &lt;td&gt;&lt;input type="checkbox" class="checkbox" /&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['customer_ID'] ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo $row['Name'] ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo $row['Email'] ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo $row['booking_date'] ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo $row['booking_time'] ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['attendee_no'] ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['booking_reason'] ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $row['comments'] ?&gt;&lt;/td&gt;
                  
                  &lt;td&gt;
              &lt;a href="#" onclick="javascript:TriggerOutlook(&lt;?php echo $row['Email'];?&gt;)" value="submit"&gt;Email this Codesnippet&lt;/a&gt;&lt;/a&gt;
              &lt;/td&gt;
              
              
              &lt;/tr&gt;
                   &lt;?php
               }
    ?&gt;
          &lt;/table&gt;  </code></pre>
  </div>
  </div>
  </p>
  
  <p>The function below gets the pop up to display for outlook mail 
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script  type="text/javascript"&gt; TriggerOutlook(Email)
  
      {    
      
    var $to      = 'Email';
    var body = "your booking has been approved";
          &lt;!-- var body = escape(window.document.title + String.fromCharCode(13)+ window.location.href);        ---&gt;
  
          var subject = "Your booking request";
  
                          window.location.href = "mailto:?body="+body+"&amp;to="+$to+"&amp;subject="+subject;               
  
              }   
  
      &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>if i put in an email manually into the var $to = the outlook pop up works however if i try to take the email from the table it doesnt, can anyone help me out to identity where i am going wrong? Thanks!</p>