Bug 97792 - Sending mail fails on Windows 10 with Mail app
Summary: Sending mail fails on Windows 10 with Mail app
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.0.4.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: File-Send
  Show dependency treegraph
 
Reported: 2016-02-12 11:00 UTC by Gerhard Schaber
Modified: 2022-06-27 07:05 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerhard Schaber 2016-02-12 11:00:02 UTC
With Windows 10 it is not possible to send mail via the Mail app. Neither via the File menu, nor via Basic:

mailSvc = createUnoService("com.sun.star.system.SimpleSystemMail")
mailClient = mailSvc.querySimpleMailClient()
msg = mailClient.createSimpleMailMessage()
msg.setRecipient(mailAddr)
msg.setCcRecipient(Array(mailCCAddr, ";"))
msg.setSubject(subject)
msg.Body = "Content"
mailClient.sendSimpleMailMessage(msg, com.sun.star.system.SimpleMailClientFlags.DEFAULTS)

The default client is set to the Mail app that is coming with Windows 10.
Windows 10 Pro 64bit in Virtualbox VM.

It works with normal (non app?) programs such as Mozilla Thunderbird.
Comment 1 Xisco Faulí 2017-04-13 09:46:06 UTC
Hello Gerhard,

Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Comment 2 Gerhard Schaber 2017-04-13 15:02:40 UTC
Same thing. Tried with 5.3.2.2.

I have even installed the Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 from https://www.microsoft.com/en-us/download/details.aspx?id=1004, and selected the Windows mail app as default mail application in Windows 10 (version 1703, build 15063).
Comment 3 Dennis Roczek 2017-04-24 09:46:05 UTC
That's strange. When Mail is the Standard App; mailto: Links do open Mail but when sending per Writer Outlook opens and attaches file...

something is fishy here!
Comment 4 Gerhard Schaber 2017-04-24 10:16:07 UTC
It seems it uses a different protocol when mailto is associated with an app instead of a desktop program.
Comment 5 Dennis Roczek 2017-04-24 15:34:24 UTC
no, i just rechecked: the mailto: protocol is associated at the moment with Mail.

so, I have no clue. ;-)
Comment 6 Sam Smith 2018-09-24 10:34:43 UTC Comment hidden (spam)
Comment 7 Ava William 2018-10-29 09:47:02 UTC Comment hidden (spam)
Comment 8 Ramson Roni 2019-05-08 22:59:18 UTC Comment hidden (spam)
Comment 9 AngelaAngie 2020-03-28 11:36:57 UTC Comment hidden (spam)
Comment 10 QA Administrators 2022-03-31 03:34:20 UTC Comment hidden (obsolete)
Comment 11 Gerhard Schaber 2022-03-31 15:51:19 UTC
Version: 7.3.1.3 (x64) / LibreOffice Community
Build ID: a69ca51ded25f3eefd52d7bf9a5fad8c90b87951
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: de-AT (de_AT); UI: de-DE
Calc: threaded

Same behavior.
Comment 12 Gerhard Schaber 2022-03-31 16:01:53 UTC
Interesting, with Mozilla Thunderbird installed, and Mail being the default mail application, the piece of code above starts Thunderbird instead of Mail.

When I check in the Windows settings the standard apps based on the protocol, for protocol "Mailto" it says "Thunderbird URL" on the left side, and "Mail" being the associated default app on the right side.
Comment 13 Gerhard Schaber 2022-03-31 16:20:07 UTC
It seems to be only related to what is in HKEY_CURRENT_USER\Software\Clients\Mail\default, and not the configured default Mail app. But this could be more like a general Windows issue
Comment 14 Gerhard Schaber 2022-03-31 16:23:14 UTC
"Thunderbird URL" is used in HKEY_CLASSES_ROOT\mailto for some reasn, even, if the default mail app is Mail.
Comment 15 Mike Kaganski 2022-06-27 07:05:39 UTC
So:

1. LibreOffice uses Simple MAPI protocol on Windows in com.sun.star.system.SimpleSystemMail implementation (also used for File->Send->Email Document);
2. The protocol is configured in system under two registry keys:
  * HKLM\Software\Clients\Mail
  * HKCU\Software\Clients\Mail (overrides the default setting for current user)
and is independent of the mailto protocol (which is unable to control e.g. attachments without non-standard extensions unsupported in current clients for security reasons);
3. There is no easy UI to define Simple MAPI client in current Windows [2];
4. So this is possible in your system have one app assigned to mailto protocol, and another set as default Simple MAPI app (either per user, or system-wide).

Windows Mail from the store does not set itself as Simple MAPI application (I have no idea if it actually can use that API, but if it can, then it is its failure to configure itself).

This is not a LibreOffice bug, and possibly best closed as NOTOURBUG.

[2] https://stackoverflow.com/questions/54346779/is-there-any-ui-in-windows-10-to-change-the-current-mapi-provider