Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem opening mailto links containing spaces in OSX 10.8.2, Qt 5.0.0
Qt 6.11 is out! See what's new in the release blog

Problem opening mailto links containing spaces in OSX 10.8.2, Qt 5.0.0

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 991 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tw1ddle
    wrote on last edited by
    #1

    Hi all. On OSX 10.8.2 using Qt 5.0.0 I can't get emails that contain spaces to open in the default mail client. This returns false:

    @ if(QDesktopServices::openUrl(QUrl("mailto:user@foo.com?subject=Test&body=Just a test")))
    {
    return true;
    }
    else
    {
    return false;
    }
    @

    I tried switching the spaces for percent-encoded spaces, it also returns false then.

    Remove the spaces and then it returns true and opens the email as expected:

    @ if(QDesktopServices::openUrl(QUrl("mailto:user@foo.com?subject=Test&body=test")))
    {
    return true;
    }
    else
    {
    return false;
    }
    @

    I have read the documentation for QUrl and QDesktopServices but cannot figure this out. Could someone set a newbie straight? Thanks.

    It looks like the default OSX mail client should deal with mailto links with spaces "based on this":https://developer.apple.com/library/mac/#qa/qa1084/_index.html

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved