Closed Aaron0176 closed 2 months ago
I'm confused as to what you are trying to achieve. You call a MimeMessage constructor, which is not part of the Simple Java Mail api, but then you cite a log line coming from Simple Java Mail api usage.
I want to create a MimeMessage using jakarta.mail.internet.MimeMessage. Therefor I need the session parameter. Works as expected.
I was just confused because I then saw in the logs that in general I should NOT use the session parameter...
It's still not clear.
I want to create a MimeMessage using jakarta.mail.internet.MimeMessage. Therefor I need the session parameter. Works as expected.
Ok sure, but this has nothing to do with your second statement:
I was just confused because I then saw in the logs that in general I should NOT use the session parameter...
You can do the first without even having Simple Java Mail on your classpath. So I don't see the connection between you calling
new MimeMessage(session)
and the log message "Providing access to Session instance for emergency fall-back scenario".
I'm doing the following to create a MimeMessage with the current mailer session:
MimeMessage mimeMessage = new MimeMessage(session);
In the logs I read "Providing access to Session instance for emergency fall-back scenario"
What would be the recommended approach?