Results 1 to 6 of 6

Thread: Opening the default mail client

  1. #1
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Opening the default mail client

    Hi,

    How can i open user's default mail client with prefilled mail address and subject when a button is clicked in my application ?

    Thanks a lot.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Opening the default mail client

    Short answer: You can't.

    Long answer: It depends on the platform and window manager used.

    General answer: Use QProcess.

  3. #3
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Opening the default mail client

    Long answer: It depends on the platform and window manager used.
    How can i do it on windows ?

    General answer: Use QProcess.
    How can i do it using QProcess?

    What will <a href="mailto:astark1@unl.edu"> do ?

    Thanks.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Opening the default mail client

    Quote Originally Posted by munna
    How can i do it on windows ?
    Using native WinAPI calls or by looking at the registry yourself to find the default mail client and run it with QProcess. Or by using ActiveX provided that the mail client is a COM server (you can then issue commands to it through the OLE interface).


    How can i do it using QProcess?
    Just run its binary after you find out what the default mail client is. The way to issue commands to the client differs depending on the client. In some cases it might not be possible at all.

  5. #5
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Opening the default mail client

    Can I in some way use

    <a href="mailto:astark1@unl.edu"> ???

    Thanks

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Opening the default mail client

    Try it in your Start Menu -> Run. If it works there (mailto:someaddress@somehost.domain) you can try to run it via cmd.exe, but it'll probably be better to use native WinAPI launcher calls for that.

    You might also try QDS, maybe it does what you need.

Similar Threads

  1. Replies: 9
    Last Post: 23rd August 2012, 00:01
  2. Replies: 7
    Last Post: 5th January 2009, 08:27
  3. Opening swf file in the default browser
    By munna in forum Qt Programming
    Replies: 16
    Last Post: 5th May 2006, 09:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.