Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeking example code #4

Closed
axtens opened this issue Sep 13, 2023 · 11 comments
Closed

Seeking example code #4

axtens opened this issue Sep 13, 2023 · 11 comments
Labels
enhancement New feature or request

Comments

@axtens
Copy link

axtens commented Sep 13, 2023

I finally have managed to get everything installed properly and working ... up to a point. I was rather hoping for some demonstration code and I haven't seen much. I may not be looking in the correct location.

My client already has an application fully built and is not about to make wholesale changes to accommodate a different workflow. I have been asked simply to find an email tool that will talk to GMail via OAuth and bolt that on as simply as possible to the existing code base in place or the previous username/password email client that had been in use before.

Is it impossible simply to create a mail object, populate fields and send as one might do in C# with Microsoft's Mail libraries or via Google Apps Script and GMail? If it is impossible, please point out to me a possible solution.

@prrvchr
Copy link
Owner

prrvchr commented Sep 13, 2023

Hi axtens,

Is it impossible simply to create a mail object, populate fields and send as one might do in C# with Microsoft's Mail libraries or via Google Apps Script and GMail? If it is impossible, please point out to me a possible solution.

eMailerOOo is an extension written in Python allowing, through the use of UNO services specific to LibreOffice, to send emails.
It is possible to write a macro (in Basic or Python), a component or an extension (in Python, Java or C) in LibreOffice which will use these UNO services in order to send emails.

eMailerOOo is not an API in the broad sense, but only an extension of LibreOffice's UNO services and will only be accessible via programs written in LibreOffice (macro, component or LibreOffice extension).

Now if this satisfies you, then I could give you some example code to send an email.

@axtens
Copy link
Author

axtens commented Sep 13, 2023 via email

@prrvchr
Copy link
Owner

prrvchr commented Sep 13, 2023

The following code examples are in Python and are extracted from the code implemented in the eMailerOOo extension:

@axtens
Copy link
Author

axtens commented Sep 25, 2023

This is harder than I thought. I can read Python a little bit. Trying to get my head into the OO environment is harder. Sadly the client's work is all in BASIC.

@prrvchr
Copy link
Owner

prrvchr commented Oct 6, 2023

Sadly the client's work is all in BASIC.

I must admit that under Basic only the methods of the SpoolerService.idl and MailMessage2.idl UNO services should be accessible...

Nothing exists regarding the Mozilla IspDB configuration wizard at least it is not accessible from Basic...

We should define what should be accessible from Basic, and why not integrate this into the next version?

@axtens
Copy link
Author

axtens commented Oct 6, 2023

Great idea. Wider audience and all that. Totally outside my skill-set however.

@prrvchr
Copy link
Owner

prrvchr commented Nov 2, 2023

Well, that's it... I think it's the best Basic API that exists for sending emails.
We couldn't make it simpler...

Everything happens in the new macro that you can find in: Tools -> Macros -> Edit Macros... -> eMailerOOo -> SendEmail

Be careful, the macros do not work if no document is open and the version of the extension has not changed...
I'm closing, you're free to open another one if necessary...

@prrvchr prrvchr closed this as completed Nov 2, 2023
@axtens
Copy link
Author

axtens commented Nov 3, 2023

Most grateful. Thank you.

@prrvchr
Copy link
Owner

prrvchr commented Nov 3, 2023

Your welcome. I just updated the SendEmail macro, the example is more elaborate...
You need to re-download the extension.

@prrvchr
Copy link
Owner

prrvchr commented Nov 4, 2023

I had to modify the API again so that it would be able to report us if the IspDB connection Wizard was canceled...
I think that now the API should be functional, I will let you report any malfunction...

@prrvchr prrvchr pinned this issue Jan 23, 2024
@prrvchr
Copy link
Owner

prrvchr commented Sep 19, 2024

I add another example code: How to send an email with a Google account

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants