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. File attachment by QDesktopServices::openUrl

File attachment by QDesktopServices::openUrl

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 902 Views
  • 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.
  • S Offline
    S Offline
    samdol
    wrote on last edited by samdol
    #1

    Hi,

    I tried to call my email client to attach a picture file by

    QString filePath ="c:/myf/aft.jpg"
    QDesktopServices::openUrl(QUrl("mailto:?subject=test&body=test&attachment;="
    + filePath));
    

    It calls my mail client program, but it did not attached the file.
    I tried both windows and linux. Is this a bug or do I have to do something else?

    the_T 1 Reply Last reply
    0
    • S samdol

      Hi,

      I tried to call my email client to attach a picture file by

      QString filePath ="c:/myf/aft.jpg"
      QDesktopServices::openUrl(QUrl("mailto:?subject=test&body=test&attachment;="
      + filePath));
      

      It calls my mail client program, but it did not attached the file.
      I tried both windows and linux. Is this a bug or do I have to do something else?

      the_T Offline
      the_T Offline
      the_
      wrote on last edited by
      #2

      @samdol

      iirc mailto: does not allow this by definition.

      -- No support in PM --

      1 Reply Last reply
      2
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by
        #3

        Only a minority of clients allow attachments via a mailto: link as it's a potential security vulnerability. You have to rely on the client's own API to include attachments to email and there is nothing Qt can do about it

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        3

        • Login

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