Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57816

Windows 10: QDesktopServices::openUrl with mailto-URL no longer opens window to select program which should be used to open file nor returns error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.9
    • 5.7.0
    • QPA: Windows
    • None
    • OS: Windows 10
    • b07a06745eb79057ccc08bc908b2df866bc38ac0 (qtbase/5.9, 22.3.2017, 5.9)

    Description

      On Windows 10 when I try to send email like QDesktopServices::openUrl(QUrl("mailto:?to=example@gmail.com&subject=Subject&body=Body", QUrl::TolerantMode)) Qt does nothing until I install email client and returns true. If in system installed any email client it will be opened.
      Also tested on Windows 8, and if there are no any email clients it will open standard window which program should be used(Select program.png). And print debug output: "Cannot launch 'mailto:?to=example@gmail.com&subject=Subject&body=Body': There is no mail program installed."

      5.7.0 Windows 10
      HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\mailto\UserChoice Progid=""
      HKEY_CLASSES_ROOT\mailto\shell\open Command/.=""C:\WINDOWS\system32\rundll32.exe" "C:\WINDOWS\system32\url.dll",MailToProtocolHandler %l"
      
      url=QUrl( mailto : ?to=example@gmail.com&subject=Subject&body=Body ), valid=true
      
      ok= true
      
      5.4.2 Windows 8
      HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\
      mailto\UserChoice Progid=""
      HKEY_CLASSES_ROOT\mailto\shell\open Command/.=""
      
      url=QUrl(mailto : ?to=example@gmail.com&subject=Subject&body=Body) , valid= true
      
      Cannot launch 'mailto:?to=example@gmail.com&subject=Subject&body=Body': There is
      no mail program installed.
      ok= true
      

      Attachments

        1. default apps.png
          default apps.png
          41 kB
        2. Mail app.png
          Mail app.png
          11 kB
        3. Open with.png
          Open with.png
          181 kB
        4. qtbug57816_diag.diff
          2 kB
        5. qtbug57816_process_launcher.zip
          2 kB
        6. qtbug57816.zip
          2 kB
        7. Select program.png
          Select program.png
          8 kB
        8. untitled.7z
          3 kB
        9. Win 8 output.png
          Win 8 output.png
          92 kB
        For Gerrit Dashboard: QTBUG-57816
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            khalupa.roman Roman khalupa
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes