On UNIX, I was suggesting you write a script to wrap the email functionality so this can be customized without recompilation, then call this from the C++ program.
On Windows you should use the MAPI 2 interface, this provides an COM/OLE interface to a mail provider and supports adding attachments as part of the API.
popen is a very simple function to use. It allows you to open a system command as a FILE stream, for reading or writing. To send an email, you will want to open a stream for writing so you can "print" the contents of the email into the function:
You would, of course, want to add some error checking to this.