I have previous topic which entitled "How to send Email in Evolution mail using Calc Macro" (link:http://ooo-forums.apache.org/en/forum/v ... =9&t=90100)
However, my problem now is that my code is working but not sending automatically.
It just create an email and waiting for manual clicking of "Send button"
I am using Evolution as Mail application. Unfortunately, this is the required application on my work.
Below is my codes that create mail but not sending automatically.
Hope you can help me to revise my code to send my message without showing my current configured system mail client
Code: Select all
Sub SendMailPlease
eMailAddress = "**********@****.com"
eSubject = "Test email"
Sheet = ThisComponent.Sheets.getByName("Macro")
Cell = Sheet.getCellrangeByName("H3")
eBody = "Sample"
eMailer = createUnoService("com.sun.star.system.SimpleCommandMail")
eMailClient = eMailer.querySimpleMailClient()
eMessage = eMailClient.createSimpleMailMessage()
eMessage.Recipient = eMailAddress
eMessage.Subject = eSubject
eMessage.Body = eBody
'AttachmentURL = convertToUrl("")
'eMessage.Attachement = Array(AttachmentURL)
eMailClient.sendSimpleMailMessage ( eMessage,com.sun.star.system.SimpleMailClientFlags.NO_USER_INTERFACE)
End Sub