bbottema / simple-java-mail

Simple API, Complex Emails (Jakarta Mail smtp wrapper)
http://www.simplejavamail.org
Apache License 2.0
1.2k stars 261 forks source link

[Feature] Implement SJM as daemon process, so CLI is much faster and can utilise the batch-module #488

Open Al-mcne opened 6 months ago

Al-mcne commented 6 months ago

23:59:46 [main] WARN BatchSupport - Starting SMTP connection pool cluster: JVM won't shutdown until the pool is manually closed with mailer.shutdownConnectionPool() (for each mailer in the cluster)

How I can use your Simple-jave-mail in the batch mode? I supplied all the required parameters for CLI. An email was successfully sent, but the process was never completed. I'm thinking about a fully automated process and "manual" Ctrl^C is not a option. How I can automatically close the current SJM process? image

bbottema commented 6 months ago

Hhm, I'm wondering if the batch module makes sense on the CLI at all, since you can't actually send emails in batches on the CLI. Each action is a separate process and connection pools don't last between sessions.

What I mean is Simple Java Mail doesn't have a daemon process running in the background... I never thought about that before, but it's a nice feature request to think about! Would speed up sending emails significantly (after initially spinning up a daemon).

You can simply remove the batch-module.jar from the libraries folder, for now. That will solve your immediate problem.

Al-mcne commented 6 months ago

Thank you for the quick solution! It works perfectly on the Windows platform (sjm.bat) Later I will validate the same solution on Linux.

Thank you again! Alex image