title: Send multiple rows of pandas dataframe in email python, preferably with html formatting
body: <p>I have a program that does the following:<br>
  1. Signs into our mail server<br>
  2. Checks for mail from a specific sender with excel files attached<br>
  3. Downloads the files<br>
  4. Opens them in pandas<br>
  5. Finds relevant information for our team / the person I am developing this application for<br>
  6. Sorts the information by date (They are times for our servers to be patched and when they will be going through maintenance)<br>
  7. Finds the unique date and time pairs and breaks them into their own dataframes<br></p>
  
  <p>NOW the final step is I need to send appointments via outlook.  All is fine, I have that built, but I'm not sure how to make the body contain what I want.  I essentially want to add the entirety of the dataframes for that unique day / time pair to be added as a table in the email body.  How can I do this?  Right now I'm just thinking about constructing a large string with for loops but I know pandas and email are two of the most developed and powerful modules, so I'm very curious if I can export a table and add it.</p>
  
  <p>I want to use <code>outlookemail.HTMLBody = dataframe.to_html()</code> but I am erroring out here</p>
  
  <pre><code>def send_appointment(day, times, newframe):
      if len(newframe)&gt;0:
          outlook = win32.Dispatch('outlook.application')
          newmail = outlook.CreateItem(1)
          newmail.Start = day+' '+times
          newmail.Subject = 'Server Patching'
          newmail.Duration = 60
          html_string = (newframe.to_html())
          print(html_string)
          newmail.help()
          newmail.HTMLBody = html_string
          #for xy in np.arange(len(newframe)):
  
  
          mail.Location = 'redacted'
          mail.MeetingStatus = 1
          mail.Recipients.Add('redacted')
          mail.Send()
  </code></pre>