File attachment by QDesktopServices::openUrl
I tried to call my email client to attach a picture file by
QString filePath ="c:/myf/aft.jpg" QDesktopServices::openUrl(QUrl("mailto:?subject=test&body=test&attachment;=" + filePath));
It calls my mail client program, but it did not attached the file.
I tried both windows and linux. Is this a bug or do I have to do something else?
mailto:does not allow this by definition.
Only a minority of clients allow attachments via a
mailto:link as it's a potential security vulnerability. You have to rely on the client's own API to include attachments to email and there is nothing Qt can do about it