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

QDesktopServices::openUrl fails for "mailto:" with gmail

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.9.5
    • Core: Other
    • None
    • Windows 10 and Chrome
    • Windows

    Description

      When I use QDesktopServices::openUrl with a "mailto:" link to open the user's email client, if works if that client is something like Outlook. But if the client is Chrome, configured to open gmail, the entire contents of the body all end up in the 'to' field of the email.

      My code is:

      QDesktopServices::openUrl(QUrl("mailto:" + to + "&subject=" + subject + "&body=" + body, QUrl::TolerantMode));

      The subject and body is mostly plaintext, along with some "\n" line endings. I have also tried with a simpler body that has no "\n" – just very plain text. Same issue.

      I have tried encoding the to, subject, and body prior to executing the code above, but with no help as well.

      For the code above, with the following QStrings:
      to: "support@csaim.com"
      subject: "CedarsReport Bug Report"
      body: "An unhandled error occurred in preview.ts: updateWatchers"

      the following ends up in gmail's "to" field:

      support@csaim.com&subject=CedarsReport Bug Report&body=An unhandled error occurred in preview.ts: updateWatchers

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            cnn Qt Core & Network
            vern.jensen Vern
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes