[Closed]XSimpleMailMessage.setOriginator not changing sender

Creating a macro - Writing a Script - Using the API

[Closed]XSimpleMailMessage.setOriginator not changing sender

Postby owlbrudder » Thu Mar 30, 2017 7:50 am

I am setting up a system to send an email to a number of people. On my Fedora 25 system, I use Evolution mail. In this I have two accounts: my personal account and one for a club I belong to.

I want the emails to have the sender address set to that of my club account.

This is my code:
Code: Select all   Expand viewCollapse view
Sub subSendEmail(strRecipient As String, strSender As String, strSubject As String, strMessage As String)
   Dim objClient As Object
   Dim objMessage As Object
   
   objClient = createUnoService("com.sun.star.system.SimpleCommandMail")
   objMessage = objClient.createSimpleMailMessage()
   objMessage.setRecipient(strRecipient)
   objMessage.setOriginator(strSender)
   objMessage.setSubject(strSubject)
   objMessage.Body = strMessage
subInspect(objMessage)
   objClient.sendSimpleMailMessage(objMessage, 2)
End Sub


subInspect uses MRI and I can see that the Originator is correctly set to the club email address. When I let the code continue, the resulting email created by Evolution instead has my personal account as the sender.

Is this known behaviour, or am I doing something wrong? "8-[
Last edited by owlbrudder on Fri Mar 31, 2017 12:12 am, edited 1 time in total.
LibreOffice Version: 5.3.3.0
Fedora 26 Linux x86_64
Core i7, 8Gb
owlbrudder
 
Posts: 93
Joined: Tue Nov 08, 2016 8:04 am

Re: XSimpleMailMessage.setOriginator not changing sender

Postby Zizi64 » Thu Mar 30, 2017 10:16 am

Ma Thunderbird email client software work similarly: the mail address of the Default outgoing account will be used instead of the Originator string adjusted by the macro in the LibreOffice
Tibor Kovacs, Hungary; LO4.4.7, LO5.3.7 on Win7x64Prof.
PortableApps, WinPenPack: LO3.3.0-LO5.4.2 and AOO4.1.3
Please, edit the topic's initial post, and add the word "[Solved]" at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 6079
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: XSimpleMailMessage.setOriginator not changing sender

Postby owlbrudder » Thu Mar 30, 2017 10:32 am

Zizi64 wrote:Ma Thunderbird email client software work similarly
Thanks for the reply.

I suppose the same applies to use of the flag NO_USER_INTERFACE which is documented as "Does not show the current configured system mail client, but sends the mail without any further user interaction.", because that does not seem to work either.

Sigh. "8-[
LibreOffice Version: 5.3.3.0
Fedora 26 Linux x86_64
Core i7, 8Gb
owlbrudder
 
Posts: 93
Joined: Tue Nov 08, 2016 8:04 am


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 6 guests