I have a very simple application to test the email service.
Qt Code:
  1. ui->setupUi(this);
  2. QString fileName=QFileDialog::getOpenFileName(this,"Attach File");
  3. qDebug()<<fileName;
  4. QDesktopServices::openUrl(QUrl("mailto:recipient@example.com?subject=Test&body=This is the body&Attach="+fileName));
To copy to clipboard, switch view to plain text mode 
I want to attach a file to the email. When i run the application the email opens but there is no attachment. The application output show a bunch of messages from a process called ShellStreams and the last message of the list is ShellStreams: Detach and the file name that i tried to attach. If i'm in other application, lets say PDF, i can attach files to the email popup. I looked on line but most of the answers where for linux. Any idea how to solve this?
Here is the output from my program:
Qt Code:
  1. ShellStreams: Attach
  2. ShellStreams: InitializedTrying to load localized resources for LANGID 1033 with Primary LANGID 9 code en name English (Universal)Resource DLL loaded at path C:\Program Files (x86)\Common Files\Apple\Internet Services\ShellStreams.resources\en.lproj\ShellStreamsLocalized.dllNot running under explorer. Will not set thread locale5860 1EA84CC0 ENTER: ShellStreamsFolder::ShellStreamsFolder
  3. pidl = 1f50e04fd020ea3a6910a2d8802b30309d140 -> 2e80853fd6f0ec379740b3d61b4a891711800 ->
  4. 5860 1EA84CC0 ENTER: ShellStreamsFolder::CreateViewObject
  5. 5860 1EAA48E0 ENTER: ShellStreamsFolder::ShellStreamsFolder
  6. pidl = 1f50e04fd020ea3a6910a2d8802b30309d140 -> 2e80853fd6f0ec379740b3d61b4a891711800 ->
  7. 5860 1EAA48E0 ENTER: ShellStreamsFolder::CreateViewObject
  8. 5860 1EAA45E0 ENTER: ShellStreamsFolder::ShellStreamsFolder
  9. pidl = 1f50e04fd020ea3a6910a2d8802b30309d140 -> 2e80853fd6f0ec379740b3d61b4a891711800 ->
  10. 5860 1EAA45E0 ENTER: ShellStreamsFolder::CreateViewObject
  11. 5860 1EAA4FA0 ENTER: ShellStreamsFolder::ShellStreamsFolder
  12. pidl = 1f50e04fd020ea3a6910a2d8802b30309d140 -> 2e80853fd6f0ec379740b3d61b4a891711800 ->
  13. 5860 1EAA4FA0 ENTER: ShellStreamsFolder::CreateViewObject
  14. 5860 1EAA4640 ENTER: ShellStreamsFolder::ShellStreamsFolder
  15. pidl = 1f50e04fd020ea3a6910a2d8802b30309d140 -> 2e80853fd6f0ec379740b3d61b4a891711800 ->
  16. 5860 1EAA4640 ENTER: ShellStreamsFolder::CreateViewObject
  17. 5860 1EAA5000 ENTER: ShellStreamsFolder::ShellStreamsFolder
  18. pidl = 1f50e04fd020ea3a6910a2d8802b30309d140 -> 2e80853fd6f0ec379740b3d61b4a891711800 ->
  19. 5860 1EAA5000 ENTER: ShellStreamsFolder::CreateViewObject
  20. 5860 1EAA50C0 ENTER: ShellStreamsFolder::ShellStreamsFolder
  21. pidl = 1f50e04fd020ea3a6910a2d8802b30309d140 -> 2e80853fd6f0ec379740b3d61b4a891711800 ->
  22. 5860 1EAA50C0 ENTER: ShellStreamsFolder::CreateViewObject
  23. 5860 1E8C5E98 ENTER: ShellStreamsFolder::ShellStreamsFolder
  24. pidl = 1f50e04fd020ea3a6910a2d8802b30309d140 -> 2e80853fd6f0ec379740b3d61b4a891711800 ->
  25. 5860 1E8C5E98 ENTER: ShellStreamsFolder::CreateViewObject
  26. 5860 1E8C6618 ENTER: ShellStreamsFolder::ShellStreamsFolder
  27. pidl = 1f50e04fd020ea3a6910a2d8802b30309d140 -> 2e80853fd6f0ec379740b3d61b4a891711800 ->
  28. 5860 1E8C6618 ENTER: ShellStreamsFolder::CreateViewObject
  29. 5860 1E8C62B8 ENTER: ShellStreamsFolder::ShellStreamsFolder
  30. pidl = 1f50e04fd020ea3a6910a2d8802b30309d140 -> 2e80853fd6f0ec379740b3d61b4a891711800 ->
  31. 5860 1E8C62B8 ENTER: ShellStreamsFolder::CreateViewObject
  32. 5860 1E8C67F8 ENTER: ShellStreamsFolder::ShellStreamsFolder
  33. pidl = 1f50e04fd020ea3a6910a2d8802b30309d140 -> 2e80853fd6f0ec379740b3d61b4a891711800 ->
  34. 5860 00000000 ENTER: DllCanUnloadNow
  35. ShellStreams: Detach"C:/Users/dkolb/Documents/Develop/Test/Test1/build-TestMailPDF-Desktop_Qt_5_9_1_MinGW_32bit-Debug/FSMA.pdf"
To copy to clipboard, switch view to plain text mode