Check for email configuration?

Hi,
Is there any way to check if the email application on the users machine is actually configured?

I have a button which contains an email hyperlink in the action event, (ShowURL “mailto:contact@blahblahblah.com”)

If the email client on the user’s machine is not configured - A small info window appears (annoyingly UNDER my app’s main window) - stating that the email could not be sent due to it being unconfigured.

Due to this message appearing UNDER the main window - the user does not see it and will probably click on the link numerous times - trying to get it to work.

Any help is much appreciated.

Thank you.

That’s a good question! ShowURL just passes it off to the OS so you’d have to query the system to get it. This assumes, of course, that there’s a way to do so.

Try:

'read, which mail application is the currently selected one

#if TargetMacOS then

theMailHelper = LaunchServicesDefaultHandlerForURLSchemeMBS("mailto")

#elseif TargetWin32 then

dim theRegItem as new RegistryItem("HKEY_LOCAL_MACHINE\\Software\\Clients\\Mail")
dim theResult as Variant = theRegItem.DefaultValue
theMailhelper = theResult.StringValue

#endif

The Mac solution needs the MBS plugin. I don’t know if this is also in macoslib.

This is all moot for the vast majority of people who use web-based e-mail.

here is ObjC code if anyone wants to translate it to declares

  char urlBuf[2048];

        LSCopyDisplayNameForURL(appURL, &appName);

        GetBuf(scheme, schemeBuf, sizeof(schemeBuf));
        GetBuf(appURLString, urlBuf, sizeof(urlBuf));
        GetBuf(appName, nameBuf, sizeof(nameBuf));

        printf("%-25s %s (%s)\
", schemeBuf, nameBuf, urlBuf);

        if (appURLString != NULL)
            CFRelease(appURLString);
        if (appName != NULL)
            CFRelease(appName);
    }

    CFRelease(apps);
    CFRelease(schemes);

    exit(0);
    return 0;

@Thom: no, they don’t. There is a major percentage using Gmail. But there are even users of Outlook left.

On the other side I don’t get how anyone could use Gmail or iCloud at all. But everyone has to decide this for herself.