Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Attaching file in Windows

    General and Desktop
    4
    5
    3748
    Loading More Posts
    • 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
      qwertyuiopearendil last edited by

      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 Reply Quote 0
      • I
        iunknwn last edited by

        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 Reply Quote 0
        • Q
          qwertyuiopearendil last edited by

          It doesn't run.

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

          1 Reply Last reply Reply Quote 0
          • S
            stukdev last edited by

            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 Reply Quote 0
            • G
              gogoud last edited by

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

              1 Reply Last reply Reply Quote 0
              • First post
                Last post