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. Attaching file in Windows
QtWS25 Last Chance

Attaching file in Windows

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 4.0k 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.
  • Q Offline
    Q Offline
    qwertyuiopearendil
    wrote on last edited by
    #1

    Hi to all, i'd like to know if someone know how can i send an email with the default email client with attachement.
    I've tryed this code:
    @
    QString fileName="C:\myfile.png";
    QDesktopServices::openUrl(QUrl("mailto:?subject=Prova &body=bodybodybody &attach="+fileName));
    @

    Into the definition of fileName there's only 1 slash even if you'll see 4

    Thanks.

    1 Reply Last reply
    0
    • I Offline
      I Offline
      iunknwn
      wrote on last edited by
      #2

      Try following variations:

      &attachment or &attachments instead of &attach. These are some variations I saw with quick googling. Also, original mailto rfc document doesn't have any notion of attachments. Those were added later as a part of MIME extentions.

      Vista x64 with Qt 4.8.2 and VS2010

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qwertyuiopearendil
        wrote on last edited by
        #3

        It doesn't run.

        If would be possible find another solution even mailto should be ok for me.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          stukdev
          wrote on last edited by
          #4

          In thunderbird you can use the command line :

          thunderbird -compose "to=asd@asd,subject=Prova,body=bodybodybody,attachment='file:///C:/logfile.log'"

          "Link...":http://kb.mozillazine.org/Command_line_arguments_(Thunderbird)

          1 Reply Last reply
          0
          • G Offline
            G Offline
            gogoud
            wrote on last edited by
            #5

            stuk's tip was very helpful for me - thanks to stuk!

            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