title: Easy Way To Send HTML Formatted Email in C++
body: <p>I have an HTML form that currently takes the inputs and sends them out in an email with HTML formatting, so that the email looks basically like the form webpage, but with all of the fields filled in.</p>
  
  <pre><code>&lt;form method="post" action="/cgi-bin/perlscript.pl" enctype="x-www-form-encoded" name="Form"&gt;
     &lt;input type="text" name="txtMyText" id="txtMyText" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The post-action script is written in Perl, and I am currently converting it to C++ simply because it is much easier for me to read and maintain that way.  Also, I think it is more flexible for future additions.</p>
  
  <p>In Perl, I was able to use "SendMail" to send the email, and I could do something like this:</p>
  
  <pre><code>sub PrintStyles
  {
  print MAIL &lt;&lt;ENDMAIL
  &lt;html&gt;
      &lt;head&gt;
          &lt;style&gt;
          h1.title { color: Red; }
          h3.title { color : Black; background-color: yellow; }
          &lt;/style&gt;
  
  &lt;!-- Put any valid HTML here that you want --&gt;
  &lt;!-- You can even put variables ($xxxx) into the HTML as well, like this: --&gt;
                  &lt;td&gt;$myVariable&lt;/td&gt;
  
  ENDMAIL
  }
  </code></pre>
  
  <p>What was nice about that, was I could literally copy-and-paste my entire CSS and HTML files (very lengthy) as long as they were in-between the "ENDMAIL" tags, and they would show up perfectly.  I could even put the variables in there without having to do any extra work.</p>
  
  <p>My questions is: <b>Is there a C++ library that has similar functionality?</b>  I really don't think I can afford to do something like this:</p>
  
  <pre><code>cout &lt;&lt; "&lt;html&gt;" &lt;&lt; endl;
  cout &lt;&lt; "&lt;head&gt;" &lt;&lt; endl;
  cout &lt;&lt; "......" &lt;&lt; endl;
  </code></pre>
  
  <p>I'd like it to be fairly light-weight.</p>
  
  <p>Thanks.</p>