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



  • 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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.