Description: When sending email in a macro using sendSimpleMailMessage your bodytext can only have one row. If you have multiple rows divided with chr$(10) (new line) all rows ends up as additional recipents. LibreOffice 4.4.3.2 Base on Linux Mint 17.2 Mate 1.10.2 have not this problem. LibreOffice 5.1.6.2 Base on Linux Mint 18.3 Mate 1.18.0 have not this problem. LibreOffice 5.4.7.2 Base on Linux Mint 19.3 Cinnamon 4.4.8 have this problem. LibreOffice 6.0.7.3 Base on Linux Mint 19.3 Cinnamon 4.4.8 have this problem. Code: eMailer = createUnoService("com.sun.star.system.SimpleCommandMail") eMessage = eMailer.createSimpleMailMessage() eMessage.Recipient = eMailAdress eMessage.Subject=eSubject eMessage.Body=bodytext eMessage.Attachement=(Array(convertToUrl(filepath))) eMailer.sendSimpleMailMessage ( eMessage, _ com.sun.star.system.SimpleMailClientFlags.NO_USER_INTERFACE ) System: LO version 6.0.7.3 CPU threads: 8, OS: Linux 5.4, UI render: default, VCL: gtk3 Locale: sv-SE (en_US.UTF-8) Linux Mint 19.3 Cinnamon 4.4.8 Steps to Reproduce: 1.Run the code above 2. 3. Actual Results: The mail client (tested thunderbird and evolution) opens up. If there is a chr$10 (new line) in the bodytext no rows are put into the bodytextfield. In the recipients field the original recipient is inserted and one recipient for every bodytext-row. Expected Results: Only one recipient and all rows of the bodytext in the bodytext field. Reproducible: Always User Profile Reset: No OpenGL enabled: Yes Additional Info: -
On pc Debian x86-64 with master sources updated today, I don't reproduce this. I gave a try with: Sub Main eMailer = createUnoService("com.sun.star.system.SimpleCommandMail") eMessage = eMailer.createSimpleMailMessage() eMessage.Recipient = "test@test.fr" eMessage.Subject="subject" eMessage.Body="body1" + chr$(10) + "body2" + chr$(10) + "body3" eMessage.Attachement=(Array(convertToUrl(filepath))) eMailer.sendSimpleMailMessage ( eMessage, _ com.sun.star.system.SimpleMailClientFlags.NO_USER_INTERFACE ) End Sub 6.0 is an old branch. Could you give a try to last stable LO version 6.4.5?
Created attachment 164153 [details] Screenshot of output
Thank you for your feedback. Could you also attach the precise macro code you used?
The screenshot was with LO 6.4.5 code: sub send_email(filepath as String, eMailAdress as String, yourOrderno as String) Dim eSubject as String Dim eMailer as Object Dim eMailClient as Object Dim eMessage as Object eSubject = "Delivery note your order " & yourOrderno eMailer = createUnoService("com.sun.star.system.SimpleCommandMail") eMessage = eMailer.createSimpleMailMessage() eMessage.Recipient = eMailAdress eMessage.Subject=eSubject eMessage.Body="Text1" & chr$(10) & "Text2" & chr$(10) & "Text3" eMessage.Attachement=(Array(convertToUrl(filepath))) eMailer.sendSimpleMailMessage ( eMessage, _ com.sun.star.system.SimpleMailClientFlags.NO_USER_INTERFACE ) End sub
I still don't reproduce the problem with your code (after having args of the function since LO complains I call the macro without args). It seems I can't help here => uncc myself. Since I don't have more questions, I'll put it back to UNCONFIRMED.
LO 5.1.6.2 seems to be the last version working. LO 5.2.7.2 and onwards has this issue.
Tested with claws-mail instead of thunderbird and that was working with LO 6.4.5. The issue seems to be between thunderbird and LO from version 5.2.7.2 and onwards.
Hello Zeke, A new major release of LibreOffice is available since this bug was reported. 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.
New test with LO7. New clean install of Linux Mint 20.1 Cinnamon. sudo add-apt-repository ppa:libreoffice/ppa Upgrade LO to latest fresh. Assign an account to Thunderbird and test it so it can send email. Run this code: sub send_email(filepath as String, eMailAdress as String, yourOrderno as String) Dim eSubject as String Dim eMailer as Object Dim eMailClient as Object Dim eMessage as Object Dim bodytxtstring as string eSubject = "Delivery note your order " & yourOrderno bodytxtstring="Please find delivery note attached" & chr$(10) & "as pdf." & chr$(10) & "Best Regards ..." eMailer = createUnoService("com.sun.star.system.SimpleCommandMail") eMessage = eMailer.createSimpleMailMessage() eMessage.Recipient = eMailAdress eMessage.Subject=eSubject eMessage.Body=bodytxtstring eMessage.Attachement=(Array(convertToUrl(filepath))) eMailer.sendSimpleMailMessage ( eMessage, _ com.sun.star.system.SimpleMailClientFlags.NO_USER_INTERFACE ) end sub Result in Thunderbird: From: zxc@gmail.com To: vbn@gmail.com To: Please find delivery note attached To: as pdf. To: Best Regards ... Subject: Delivery note your order 254456 Bodytext: (Nothing) The bug seems to still be present in LO7. Due to the bug we use the following code instead: eSubject = "Delivery note " & deliveryID & " from your order no " & yourOrderno shellstring="thunderbird -compose subject=" & eSubject & ",to=" & eMailAdress & ",message=/home/user1/Businessystem/txt/Deliveryconftxt,attachment='" & filepath & "'" shell shellstring
I am also having this EXACT problem with Libreoffice + Linux Mint + Thunderbird setting. But it works well with evolution or Geary email client. BTW Zeke, can you elaborate on your workaround code ? -------------------- Due to the bug we use the following code instead: eSubject = "Delivery note " & deliveryID & " from your order no " & yourOrderno shellstring="thunderbird -compose subject=" & eSubject & ",to=" & eMailAdress & ",message=/home/user1/Businessystem/txt/Deliveryconftxt,attachment='" & filepath & "'" shell shellstring --------------------- what exactly is this shellstring stuff ?
Explanation of the workaround we use as requested by Pharmankur: eSubject = "Delivery note " & deliveryID & " from your order no " & yourOrderno shellstring="thunderbird -compose subject=" & eSubject & ",to=" & eMailAdress & ",message=/home/user1/Businessystem/txt/Deliveryconftxt,attachment='" & filepath & "'" shell shellstring Shell execute a command at the cl (commandline) Shellstring is a textstring with the command. thunderbird starts thunderbird. -compose tells thunderbird to initiate a mail to send. subject= sets the mails subject. to= sets the mails reciepent. message= path to a textfil containing the bodytext of the mail. attachment= path to a attachment file.
Thank You Zeke for your quick response That's a great workaround. Thanks for sharing.
Dear Zeke, Based on your idea (of using shell script from libreoffice Macro) prepared a demo file. It makes use of MUTT Details are here --- https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=90100#p521622
You will always need one recipient in the 'TO' field so in order for the mass email to get sent, simply type your own email address there. This will show them that you care about their privacy and they'll be grateful for your thoughtful actions.
You will always need one recipient in the 'TO' field so in order for the mass email to get sent, simply type your own email address there. https://routerlogin.ltd/ https://pikashow.ltd/
Ensure your mass email gets sent by entering your own email address as the recipient in the 'TO' field. https://spotsungs.com/spotify-premium-apk-2/
Is it legal to download your own Instagram Reels? check full faq from here: https://storiessaver.org/reels/
Setting to new as per comment 10. Version and regression keywords as per comment 6.
Is this the same issue as https://bugzilla.mozilla.org/show_bug.cgi?id=208230 ? Which would make it "not our bug"?
Pikashow apk provides online streaming of content, including shows and cricket, to attract multiple users for free. Pikashow for PC contains extraordinary content which is available in web stories, live TV channels, TV shows, sports, and cricket categories for PC/Desktop (Windows/Macbook/Linux) users.
The prominent benefit of using [Pikashow](pikashowpc.com) on Windows and Macbooks is its high-density streaming feature, as it provides high-quality watching content. For Mac users, the app provides a maximum of 4K quality options, which is incredible and focuses on showing content perfectly.
You must always have one recipient in the 'TO' field for the mass email to be sent. To accomplish this, just enter your own email address in that field.
(In reply to Stéphane Guillou (stragu) from comment #19) > Is this the same issue as > https://bugzilla.mozilla.org/show_bug.cgi?id=208230 ? No. If it were, then the multiline text would appear as single-line with newlines converted to whitespace. Here, the additional lines appear as additional CC addresses. (In reply to Julien Nabet from comment #1) > On pc Debian x86-64 with master sources updated today, I don't reproduce > this. If it is reproducible - i.e., if the wrong CC addresses are added - would depend on the way mailer is configured in LibreOffice. Specifically, if the actual command executed in https://opengrok.libreoffice.org/xref/core/shell/source/unix/misc/senddoc.sh is xdg-email (when the mailer is not explicitly configured, or the command is entered manually), then the problem will be reproduced. If I specify 'thunderbird' explicitly, the problem is *not* reproducible that way (I don't have wrong CC addresses) - but the body is still not correct (this bit, unfortunately, is unclear in comment 1). Having LibreOffice (24.8.3.2) and Thunderbird (115.16.0esr), both installed using apt on my Ubuntu (22.04.5 LTS), I don't have a body at all, even passing a single-line text to eMessage.Body; this is both then using 'xdg-email' and 'thunderbird' as configured mailer. In case of 'xdg-email', I see the *second* and following lines as CC addresses - but the first line is lost, anyway. The shell script seems to have bis troubles; see e.g. bug 162632. Please note, that the issue is to debug the mentioned shell script, which is the actual thing executed when you use the SimpleCommandMail service. It is enough to edit it directly (in the LibreOffice installation directory) - adding some debug output could be the first step.
FTR: the shell script in the installed LibreOffice likely has no ".sh" extension: e.g., on my system, it's /usr/lib/libreoffice/program/senddoc
(In reply to Mike Kaganski from comment #23) > If I specify 'thunderbird' explicitly, the problem is *not* reproducible > that way (I don't have wrong CC addresses) - but the body is still not > correct (this bit, unfortunately, is unclear in comment 1). > > Having LibreOffice (24.8.3.2) and Thunderbird (115.16.0esr), both installed > using apt on my Ubuntu (22.04.5 LTS), I don't have a body at all, even > passing a single-line text to eMessage.Body; this is both then using > 'xdg-email' and 'thunderbird' as configured mailer. Please ignore the part about the *missing* body in my comment 23: it turned out, that it was caused by not configured account in Thunderbird (I only installed it to test, and hoped that it would work without configuring an account). Once an account was configured, the body appeared: 1. When using a command line like > thunderbird -compose to='my@email.com',subject='A subject',body='Text1 > Text2 > Text3' it worked fine. The body was three-line, as expected. 2. When using a command line like > xdg-email 'mailto:my@email.com?body=Text1 > Text2 > Text3&subject=A%20subject' the problem appeared, as explained in comment 0. The first line "Text1" was in the body, while "Text2" and "Text3" appeared as CC. 3. When using a command line like > xdg-email 'mailto:my@email.com?&subject=A%20subject' --body 'Text1 Text2 Text3' it worked fine again. The body was three-line, as expected. It seems, that the correct fix would be to use the --body argument to xdg-email.
Also this works fine: > xdg-email 'mailto:my@email.com?body=Text1%0AText2%0AText3&subject=A%20subject' So the proper URL-encoding of the body is likely enough.
Stephan Bergmann committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6d1cddea8e4e19287891ab8fb7e3774ae9976ea1 tdf#135628 Let uri-encode encode newlines It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Stephan Bergmann committed a patch related to this issue. It has been pushed to "libreoffice-25-2": https://git.libreoffice.org/core/commit/cf4ab0e50087ae631b9f187b1b554da463474c27 tdf#135628 Let uri-encode encode newlines It will be available in 25.2.0.0.beta2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.