You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to reuse a SMTP connection (and therefore jakarta.mail.Transport) for sending more that one email. I'd like to have some API that can be used like this:
try(MailerTransport transport = mailer.openTransport())
{
for(int i = 0; i<5; i++)
{
transport.sendMail(EmailBuilder.startingBlank().
...
withSubject("mail " + i + "/5"));
}
}
I can't use batch-module, as it wants to maintain threads and the message queue for me. I have just one thread fetching emails from the database and sending it to smtp blockingly. No need for parallel threads or connections pools. Just one thread reusing the transport for more than one email.
I made this possible with hacking simple-java-mail, but it says: "Providing access to Session instance for emergency fall-back scenario. Please let us know why you need it." So here I am.
Best regards,
Ralf.
The text was updated successfully, but these errors were encountered:
I'd like to reuse a SMTP connection (and therefore jakarta.mail.Transport) for sending more that one email. I'd like to have some API that can be used like this:
I can't use batch-module, as it wants to maintain threads and the message queue for me. I have just one thread fetching emails from the database and sending it to smtp blockingly. No need for parallel threads or connections pools. Just one thread reusing the transport for more than one email.
I made this possible with hacking simple-java-mail, but it says: "Providing access to Session instance for emergency fall-back scenario. Please let us know why you need it." So here I am.
Best regards,
Ralf.
The text was updated successfully, but these errors were encountered: