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. A mailto request opens an empty Chrome window
Qt 6.11 is out! See what's new in the release blog

A mailto request opens an empty Chrome window

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.4k 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.
  • N Offline
    N Offline
    noastick
    wrote on last edited by
    #1

    Hi.
    I want that a button opens an email client or a browser to send an email to certain email. I've written this slot function:
    @void MainWindow::on_actionFeedback_triggered()
    {
    QDesktopServices::openUrl(QUrl("mailto:danifujii@gmail.com?subject=THeM"));
    }
    @
    The thing is, it opens an empty Chrome window (as i don't have an email client set). But I know from other sites and apps that it is posible to use mail to for browsers.
    Thanks.

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      and what do you expect to happen when you don't have a mail client installed?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • N Offline
        N Offline
        noastick
        wrote on last edited by
        #3

        [quote author="raven-worx" date="1422458555"]and what do you expect to happen when you don't have a mail client installed?[/quote]

        I want Gmail or Hotmail to open. Cannot find the code for it.
        Or do it that if there is no client, THEN open Gmail.

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          It works in browsers because they intercept the mailto link and forward you to another site instead opening the local installed mail client.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          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