PDA

View Full Version : Opening the default mail client



munna
3rd April 2006, 04:40
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.

wysota
3rd April 2006, 13:34
Short answer: You can't.

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

General answer: Use QProcess.

munna
3rd April 2006, 13:38
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.

wysota
3rd April 2006, 13:41
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.

munna
3rd April 2006, 13:44
Can I in some way use

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

Thanks

wysota
3rd April 2006, 13:58
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 (http://qds.berlios.de/), maybe it does what you need.