[Qt-interest] How to open Outlook when 'email' button is clicked

Avishek_Sharma Avishek_Sharma at satyam.com
Fri Jan 2 13:04:11 CET 2009


Hi,
  I am sorry,I forgot to mention that the application I have been working on was  designed using Qt 3.3. Also,am working on Linux platform.
I guess,since it was designed using Qt 3,3,I won't be able to use QDesktopServices as it's available for Qt 4.2 onwards,right.
Also,it seems there's no default email client in Linux(came to know that in qtcentre.org).

One of the members there gave me a sample code to try out saying that if there's any default email client it should open up (which I am copying below)
*****************
QStringList slist;
slist +=getenv("BROWSER");
slist +=someaddr at somehost;
QProcess *proc=new QProcess(slist,this);
//....
******************
So,I modified it and tried it out(code used by me is shown below)
***********************************************
QStringList slist;
slist +=getenv("BROWSER");
slist +="mailto:abc123 at yahoo.com";
QProcess *proc=new QProcess(slist,this);
if(!proc->start())
{
 QMessageBox::critical(0,"fatal error","can't open default email client");
exit(-1);
}
************************************************
When I click on 'email' I get the message 'Can't open default.....".Does that mean that there's no email client installed in my system.I did a search on the system and came across something like an email client called 'Evolution' but,I don't think anyone's used it before or created a user  account.......Is it possible to get some site like 'Hotmail' or yahoo to open instead of the default email client?
Please advice.
Thank you.

________________________________________

On Friday 02 January 2009 05:23:20 pm Avishek_Sharma wrote:
> I have an 'email' push button on a dialog and I want that when I click
> it,it should open up 'Outlook express' .How do I do that? Please advice.

If you want it to be outlook express (or nothing), use QProcess.
If you'd prefer to use the client's preferred email package (and you almost
certainly should), use QDesktopServices. See:
http://doc.trolltech.com/4.4/qdesktopservices.html#openUrl

Brad

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest

DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.




More information about the Qt-interest-old mailing list