How to send Email in Evolution mail using Calc Macro
Posted: Fri Aug 25, 2017 4:06 am
I am searching forums but unfortunately no suitable matches were found. I do not know if I am not good in searching. I am sorry for that.
I am new in Ubuntu OS and I want to send an email in Evolution mail using Libreoffice calc.
What I am working with is that when I click the "SEND" button, it will send a message automatically to specific recipient and the cell range will be body of the letter.
Hope that you can help me to finish my project.
Thanks to those person who have big heart
UPDATE!!!!!!!!!!!!!!!!!!!!
Hello all
I already found the working code.
My problem now is that the code is just creating a mail but not automatically send the email.
Below is the code, can you help me to revise the code to be able to add the auto-sending.

I am new in Ubuntu OS and I want to send an email in Evolution mail using Libreoffice calc.
What I am working with is that when I click the "SEND" button, it will send a message automatically to specific recipient and the cell range will be body of the letter.
Hope that you can help me to finish my project.
Thanks to those person who have big heart
UPDATE!!!!!!!!!!!!!!!!!!!!
Hello all
I already found the working code.
My problem now is that the code is just creating a mail but not automatically send the email.
Below is the code, can you help me to revise the code to be able to add the auto-sending.
Code: Select all
Sub SendEmail
eMailAddress = "xxxxxx@xxxx.com"
eSubject = "Test email"
eMailer = createUnoService ("com.sun.star.system.SimpleCommandMail")
eMailClient = eMailer.QuerySimpleMailClient()
eMessage = eMailClient.createSimpleMailMessage()
eMessage.Recipient = eMailAddress
eMessage.Subject = eSubject
AttachmentURL = convertToUrl("/home/dsm/Downloads/DAGREGISTRATIE SNEL SCHOON ZUID-OOST NIEUWE STIJL 2.0.ods")
eMessage.Attachement = Array(AttachmentURL)
eMailClient.sendSimpleMailMessage ( eMessage, com.sun.star.system.SimpleMailClientFlags.NO_USER_INTERFACE )
End Sub