Can someone give me an example of how to send a mail using a C++ program? I have come across some programs but they are not that descriptive. I would also like to know what other libraries are there if I need more options.
You might be interested in libcURL.
It's a great multi-platform C library which supports a lot of different protocols, including SMTP.
The official web page contains samples and tips to get you started.
Here is one that might help you.
Bindings exists for C++ (but I never used them) if you don't want to use the C interface.
You can use libquickmail, see: http://sourceforge.net/projects/libquickmail/ This simple library allows you to easily send e-mail from C/C++ with attachments and even using SMTP authentication. It uses libcurl for the SMTP transport.
Take a look at VMime, native C++. http://www.vmime.org/ Between the examples and the test suite, you should have everything you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With