# Check for email configuration?

**URL:** <https://forum.xojo.com/t/check-for-email-configuration/11432>\
**Category:** General\
**Created:** [October 5, 2013, 11:58am UTC](https://forum.xojo.com/t/check-for-email-configuration/11432 "2013-10-05T11:58:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Summers](https://forum.xojo.com/user_avatar/forum.xojo.com/richard_summers/32/477_2.png) [@Richard\_Summers](https://forum.xojo.com/u/Richard_Summers)\
**Post date:** [October 5, 2013, 11:58am UTC](https://forum.xojo.com/t/check-for-email-configuration/11432/1 "2013-10-05T11:58:21Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![Bob\_Keeney](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/54ee81/32.png) [@Bob\_Keeney](https://forum.xojo.com/u/Bob_Keeney)\
**Post date:** [October 5, 2013, 6:20pm UTC](https://forum.xojo.com/t/check-for-email-configuration/11432/2 "2013-10-05T18:20:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [October 8, 2013, 4:51pm UTC](https://forum.xojo.com/t/check-for-email-configuration/11432/3 "2013-10-08T16:51:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Thom\_McGrath](https://forum.xojo.com/user_avatar/forum.xojo.com/thom_mcgrath/32/192_2.png) [@Thom\_McGrath](https://forum.xojo.com/u/Thom_McGrath)\
**Post date:** [October 8, 2013, 5:09pm UTC](https://forum.xojo.com/t/check-for-email-configuration/11432/4 "2013-10-08T17:09:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [October 8, 2013, 5:41pm UTC](https://forum.xojo.com/t/check-for-email-configuration/11432/5 "2013-10-08T17:41:21Z")

</div>

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

```auto
  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;
```

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [October 8, 2013, 5:55pm UTC](https://forum.xojo.com/t/check-for-email-configuration/11432/6 "2013-10-08T17:55:02Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 4:52pm UTC](https://forum.xojo.com/t/check-for-email-configuration/11432/7 "2020-10-29T16:52:58Z")

</div>


