Dim eMailAddress as String
Dim eSubject as String
Dim eMailer as Object
Dim eMailClient as Object
Dim eMessage as Object
eMailAddress = "toto@titi.fr"
eSubject = "test"
eMailer = createUnoService("com.sun.star.system.SimpleSystemMail")
eMailClient = eMailer.querySimpleMailClient()
eMessage = eMailClient.createSimpleMailMessage()
eMessage.setRecipient(eMailAddress)
eMessage.setSubject(eSubject)
eMessage.setAttachement (Array("C:\Users\toto\titi.doc"))
eMessage.body="Ça marche?"
eMailClient.sendSimpleMailMessage( eMessage, 0 )
My question is simple but I couldn't find the answer : how do I set recipient in cc or cci with this syntax ?
I tried different things but coudn't solve it.
Thanks for your answers.
Last edited by robleyd on Wed May 10, 2023 1:45 pm, edited 1 time in total.
Reason:Tagged [Solved]. Add green tick
Dim eMailAddress as String
Dim eMailCc as String
Dim eSubject as String
Dim eMailer as Object
Dim eMailClient as Object
Dim eMessage as Object
eMailAddress = "toto@titi.fr"
eMailCc = "titi@toto.fr"
eSubject = "test"
eMailer = createUnoService("com.sun.star.system.SimpleSystemMail")
eMailClient = eMailer.querySimpleMailClient()
eMessage = eMailClient.createSimpleMailMessage()
eMessage.setRecipient(eMailAddress)
eMessage.setCcRecipient(eMailCc)
eMessage.setSubject(eSubject)
eMessage.setAttachement (Array("C:\Users\toto\titi.doc"))
eMessage.body="Ça marche?"
eMailClient.sendSimpleMailMessage( eMessage, 0 )
Okay, thanks anyway.
Finally I found out why it was not working : while setRecipient() needs a string as argument, setCcRecipient() needs an array.
In the code posted above, I replaced :
Hagar Delest wrote: ↑Wed May 10, 2023 10:54 am
Please add [Solved] at the beginning of the title in your first post (top of the topic) with the 🖉button if your issue has been fixed.
Done by a moderator.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10