Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: get default mail client for 'mailto:'

  1. #1
    ClaudeMartin NNTP User

    Default get default mail client for 'mailto:'

    I want to open the default mail client from my application to the user can send me an e-mail.
    what I did was simply try some of the common browsers (it's usually is firefox but there is also an option for the user to set another browser in my application) and let it open mailto:foo@example.com. This works on most linuxes but not on openSuse.
    Firefox tries to use evolution as the default mail-client, even if its not installed (which is the case). There is no error message so nothing happens.

    Is there a good way to find a the default mail-client or any that is installed so I can be sure something opens?

    What's the best way to do this?

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    27,217
    Blog Entries
    15

    Default Re: get default mail client for 'mailto:'

    Quote Originally Posted by ClaudeMartin
    I want to open the default mail client from my application to the user
    can send me an e-mail.
    what I did was simply try some of the common browsers (it's usually is
    firefox but there is also an option for the user to set another browser
    in my application) and let it open mailto:foo@example.com. This works on
    most linuxes but not on openSuse.
    Firefox tries to use evolution as the default mail-client, even if its
    not installed (which is the case). There is no error message so nothing
    happens.

    Is there a good way to find a the default mail-client or any that is
    installed so I can be sure something opens?

    What's the best way to do this?
    Hi
    You don't say which DE your using? In Gnome you can set preferred
    applications via the control center. I'm sure there is a KDE equivalent.

    --
    Cheers Malcolm (Linux Counter #276890)
    SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.29-0.1-default
    up 4 days 2:16, 2 users, load average: 0.46, 0.32, 0.27
    GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18


  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: get default mail client for 'mailto:'

    In KDE there is also a central place. But FF must be done sep
    aerate.

    In my FF I did the following to let FF point to Kmail:

    Type about:config in the address bar. You get a long list of parameters. Type mail in the Filter bar, this will reduce the list considarable.
    I choose network.protocol-handler.app.mailto and set it to kmailservice.

    HTH
    Henk van Velden

  4. #4
    ClaudeMartin NNTP User

    Default Re: get default mail client for 'mailto:'

    It doesn't matter what DE I use. I don't know what the end user will use. Isn't there some standard way to get those default applications?
    There is a DLL on Windows and OS X has its own Java-library. But Linux has nothing?

    I'm sure I'm not the only one with this problem. Doesn't every application at least have a link to the developers website and an e-mail-link?! How do they do that?

  5. #5
    ClaudeMartin NNTP User

    Default Re: get default mail client for 'mailto:'

    I just browsed the sourcecode of eclipse. there is lots of code simply to open a webbrowser and its rather deeply nested into the sourcecode of eclipse.
    why cant there be a simple solution?

  6. #6
    palladium NNTP User

    Default Re: get default mail client for 'mailto:'

    > How do they do that?

    if it is a gui application an email link in Help > About should work
    nicely.. [and, if "nothing happens" most folks you wanna hear from are
    *smart enough* to copy/paste to their chosen mail client..]

    or, if it is a cli application i guess it could be in README..

    or, in any case it could/should be in the documents you provide for
    /usr/share/doc/[foo]/[bar]

    --
    palladium

  7. #7
    ClaudeMartin NNTP User

    Default Re: get default mail client for 'mailto:'

    You cant copy paste a label. And people are stupid.

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: get default mail client for 'mailto:'

    Quote Originally Posted by ClaudeMartin View Post
    It doesn't matter what DE I use. I don't know what the end user will use. Isn't there some standard way to get those default applications?
    There is a DLL on Windows and OS X has its own Java-library. But Linux has nothing?
    AFAIK there is no such standard (though it wouldn't be a bad idea). That means that every product where this sort of situation may apply makes his own solution. In this case every DE does it centraly, but in its own way. FF does not belong to any of the DEs. So FF "could" try to find out if it is running within a certain DE and then try to find out in that DEs' special way. But there are many DEs. And IMHO you can not blame FF that it tries to use Mozillas mail program first.

    The difference between Linux and the other two OS brands you mention is that they are closed and it is very easy for them to implement an internal standard. Making a real international open standard for anything is not that easy, but it is these standards that Linux depends on.
    Henk van Velden

  9. #9
    ClaudeMartin NNTP User

    Default Re: get default mail client for 'mailto:'

    Quote Originally Posted by hcvv View Post
    AFAIK there is no such standard (though it wouldn't be a bad idea).
    There is $DESKTOP_LAUNCH on OpenSuse but not on other systems. I think i'll use this if it is set.

    Quote Originally Posted by hcvv View Post
    So FF "could" try to find out if it is running within a certain DE and then try to find out in that DEs' special way.
    But even for that there is no standard. How do I know on what DE I am?!

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: get default mail client for 'mailto:'

    Quote Originally Posted by ClaudeMartin View Post
    There is $DESKTOP_LAUNCH on OpenSuse but not on other systems. I think i'll use this if it is set.
    Could be something, in my session it says:
    Code:
    henk@boven:~> echo  $DESKTOP_LAUNCH
    kde-open
    henk@boven:~>
    Quote Originally Posted by ClaudeMartin View Post
    But even for that there is no standard. How do I know on what DE I am?!
    That is a good question. I assume you mean you want to detect this from a script and not from taking a glance at the screen.

    The above $DESKTOP_LAUNCH may do somethiing, but, like you, I do not know if it is an openSUSE only trick or not. Is that script running as root, or as the user? A ps with some nice options and a grep for the user might give a clue. I think for kde when /usr/bin/kde is running for that user you have something. But the user may be logged in several times with different DEs! Looking inside the environment. In my session:
    Code:
    henk@boven:~> env | grep KDE
    KDE_MULTIHEAD=false
    KDE_NO_IPV6=1
    KDE_FULL_SESSION=true
    KDE_SESSION_UID=500
    henk@boven:~>
    But you have to search for hints about a user session using Gnome, Xfce, fvwm, .......
    The user may be stupid, but when he wants something to be run he will choose his own environment. Linux is about choice.
    Henk van Velden

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •