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
Forum Updated to NodeBB v4.3 + New Features

Attaching file in Windows

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 4.0k Views 1 Watching
  • 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 23 Sept 2010, 23:43 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 24 Sept 2010, 01:04 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 24 Sept 2010, 01:38 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 24 Sept 2010, 07:08 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 16 Apr 2013, 14:54 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