How can I open the default compose mail window from the user\'s mail app from within a Qt app?
I found there is some class for mobile with Qtmobility, but I don\'t h
Old topic but :
You could also try another way, as I did, using a web service. I have a php web service that send email to a specific mail address, so I just send the message data to this web service, that will handle the rest for me.
This is to abstract yourself of using a desktop software that most of the time users don't have ( we all use gmail anyway, so you know ... ). In php :
// sending mail to my@address.com
$headers ='From: sender@address.com'."\n";
$headers .="Reply-To: replyto@address.com"."\n";
$headers .='Content-Type: text/plain; charset="iso-8859-1"'."\n";
$headers .='Content-Transfer-Encoding: 8bit';
mail('my@address.com', '[TAG] mail subject', "some body text.", $headers);
Careful of security though !
There is no built in way in Qt to send email with HTML formatting. The Mailto method will work for unformatted text, e.g.
QDesktopServices::openUrl(QUrl("mailto:?to=recipient@example.com&subject=The subject of an email&body=Here is some email body text", QUrl::TolerantMode));
But this cannot be used for html formatted text.
If you absolutely need HTML you will need to look at the options for your platform(s):