title: Convert Ruby object into HTML string with awesome_print
body: <p>I'm trying to prettify an Ruby object using awesome_print so I can place this string inside an email and send it off. So in terms of code, (I know this is wrong), but here's what I'm trying to achieve:</p>
  
  <pre><code>my_str = (ap error.object).to_str
  # Do something with my_str, like stick it in a &lt;pre&gt; tag inside an html email.
  </code></pre>
  
  <p>How do I convert the output from ap to string? Reason I'm asking is as I noticed, ap seems to only return the object.</p>