Send email from C++ application

Started by
1 comment, last by NotAYakk 15 years, 1 month ago
Is there a standard way to send an email from a C++ app on Windows/Mac/Linux? I figure it would have to rely on the PC having an email client of some sort, unless there is a nice open-source email client library I can use? For context, it's to let an app send crash/feedback emails.

www.simulatedmedicine.com - medical simulation software

Looking to find experienced Ogre & shader developers/artists. PM me or contact through website with a contact email address if interested.

Advertisement
I guess the standard way in C++ would be to open a socket to a SMTP server (port 25) and follow the very simple SMTP protocol. You should be able to find this easily if you look on Google.
Use your system's desktop services to open a mailto url.

This will open whatever mail client they have configured on the system, and it can be pre-populated with a reasonable amount of data.

Windows, Gnome, KDE and Mac all have different ways to access desktop services. Various libraries attempt to generate a unified interface to all of them -- I think glib has one. I don't know at this point how well it handles crossing platforms.

This topic is closed to new replies.

Advertisement