https://bz.apache.org/ooo/show_bug.cgi?id=111298
--- Comment #12 from [email protected] --- (In reply to Carol_FAGES from comment #11) > I'm on LibreOffice, sorry, I should have mentioned it. Oh, then it might be different. You said: ---quote--- if os_system = "LINUX" then eMailer = createUnoService("com.sun.star.system.SimpleCommandMail") else eMailer = createUnoService("com.sun.star.system.SimpleSystemMail") endif perfectly wworks on Windows, and partially works on Linux (juste have to click for sending mail). ---quote--- Presumably, LibreOffice still kept those services. The reason that on Linux it needs you to click inside the email client to send the email, is because none of the email clients have the option to send automatically. Even that new xdg-email tool I discovered says in its man page: ---snip--- All information provided on the command line is used to prefill corresponding fields in the user's e-mail composer. The user will have the opportunity to change any of this information before actually sending the e-mail. ---snip--- So unfortunately: com.sun.star.system.MailClientFlags.NO_USER_INTERFACE =1 whose description says: "Does not show the current configured system mail client GUI, but sends the mail without any further user interaction." is not quite right - it's best effort, still requiring user interaction on Linux, because no other option is supported. In fact, remarkably, in main/shell/source/cmdmail/syscmdmail.cxx which is what is used on Linux: ---snip--- 133 void SAL_CALL 134 SystemCommandMail::sendMailMessage( 135 const Reference< XMailMessage >& xMailMessage, 136 sal_Int32 /*aFlag*/ ) ---snip--- the "aFlag" is commented out and not even declared, so all the com.sun.star.system.MailClientFlags flags passed including NO_USER_INTERFACE will be completely ignored. Also the documentation on https://www.openoffice.org/api/docs/common/ref/com/sun/star/system/SystemMailProvider.html says "For a more complex way of sending mails using a SMTP serivce, without the need of a mail client on the system and with NO USER INTERACTION (uppercase mine), use the ::com::sun::star::mail::MailServiceProvider." So if you need no user interaction on all platforms, the only way to get it is to use the more complex ::com::sun::star::mail::MailServiceProvider way from the comment 4 example, which connects to an SMTP server. We should really update the documentation for com.sun.star.system.MailClientFlags to say they are best-effort / Windows-only. -- You are receiving this mail because: You are the assignee for the issue. You are on the CC list for the issue.
