Is there a way to open a user’s mail app? I was trying to use ofLaunchBrowser and then use a mailto link, but ofLaunchBrowser seems to only work on http formatted links.
On Mac you can use something like this:
#include <ApplicationServices/ApplicationServices.h>
std::string urlString = "mailto:address@domain.com";
CFURLRef url = CFURLCreateWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(urlString.c_str()), urlString.size(), kCFStringEncodingUTF8, NULL);
assert(url != NULL);
OSStatus status = LSOpenCFURLRef(url, NULL);
assert(status == noErr);
CFRelease(url);
url = NULL;
Though error handling with asserts might not be the best way in a real app
Awesome thanks pappis! That works for the Mac side. I’m not at the Windows part yet, but will be later. Thanks for the help.