Seite 1 von 1

[gelöst] Standard E-Mail Programm öffnen

Verfasst: 4. April 2008 21:35
von s-valve
Hallo,

ich würde gern über einen Menüpunkt meiner Applikation das Standard E-Mail programm des jeweiligen Systems auf dem meine App läuft öffnen und dort eine neue E-Mail erzeugen und vorbefüllen.

Unter Borland C++ hatte ich dafür folgende prop. Lösung für Win:

Code: Alles auswählen

#include <shellapi.h>

...

//prepare e-mail
AnsiString subject, mail;
subject = AppName + " " + BuildString + langString;
mail = "mailto:xyz@zyx.de?subject=" + subject + "&body=" + body;
//send an e-mail
ShellExecute(Handle, NULL, mail.c_str(), NULL, NULL, SW_NORMAL);
Wie kann ich das in Qt möglichst OS-unabhängig realisieren? Danke im Voraus.

Gruß,
M

Verfasst: 4. April 2008 21:38
von Christian81

thx

Verfasst: 4. April 2008 22:39
von s-valve
Besten Dank.

Der Form halber:

Code: Alles auswählen

QString subject = (PROJECT_NAME + " " + VERSION + " " + BUILD + " Bugreport");
QString body = (tr("Please report all noticed bugs and inconsistencies of ") + PROJECT_NAME);
const QUrl mail = ("mailto:" + PROJECT_MAIL + "?subject=" + subject + "&body=" + body);

bool ok = QDesktopServices::openUrl(mail);