The first API you will encounter in google is MAPISendMail, which offers a basic functionality through the email client (MS Outlook, Thunderbird, LiveMail etc) installed on the computer running your program. Windows compatibility is excellent, working as far back as windows 95, but it isn't perfect. Depending on which email client furnishes the outgoing email, you may or may or may not be able to send attachments; sometimes it fails completely when the client is/isn't running in the background. Not very robust. Also it will not send UTF-8 encoded messages and cannot do silent delivery — you always see the Outlook etc email composition window before the email is sent.
Your quest for the elusive simple email API will then lead you to mailto protocol, which is just meant for lightweight use from websites, not from a C++ program. It won't do attachments in most cases, and it has all the other ailments of MAPISendMail. A clever trick to ensure email attachments is SendTo shell extension that appears when you right click on files in windows explorer. The menu command Mail recipient will attach any file and send it through your email client, but that's all the control you have: you can't choose a recipient address programmatically for instance.
Then there's extended MAPI. This gives you good control, only it doesn't work for every email client. What if your program is running on a PC where there's only Thunderbird installed? You cannot force your customers to buy MS Outlook or install windows live mail just so that you can send emails using extended MAPI. In the bin with this one too.
All this control doesn't come free though. You will suddenly realize the complexities of actually sending emails doing text conversations with the SMTP server, ensuring a secure encrypted SSL connection and everything else simple MAPI does automatically behind the scenes.
Back to google for some SMTP code samples... You will find a lot of C++ code, from simple classes without SSL to monstrous implementations larger than your whole source code and cross dependencies you'd rather do without. At this point, like me, you may be about to throw the towel and buy some SMTP component with royalty free distribution to include with your program (see the references below for some links), if you don't mind adding ~1MB extra to your distribution.
It can do the lot, HTML, attachments, unicode messages, supports secure SSL. As you will see from the online reference, you need two objects, CDO.Configuration to setup the server login details, and CDO.Message to compose and send each email. There are many code samples (mostly in kindergarden languages like VB and C# :) but you can easily turn them in C++ using the CDO header files <cdosys.h> and <cdosys_i.c> and remember that a CDO:: namespace is in effect.
If you use gmail as your SMTP server, remember to use port 465 and enable SSL using cdoSMTPUseSSL on the server configuration object. I don't think CDOSYS supports TLS encryption so port 587 is out, but usually all you need is port 25 for plain text and 465 for SSL encryption.
This wraps up my 2-year journey towards SMTP nirvana. I hope this condensed version helps someone among you!