I have a service that has injected the JavaMailSender. My service configures it and sends a mail. I’d like to intercept the raw mail to ensure the information is the correct. I’d like to do that in a JUnit. How would you guys do that? Answer I’ve done it using GreenMail. Take a look at my blog post about it
Tag: jakarta-mail
How to Send bulk mails using javax.mail API efficiently? & Can we use reuse authenticated sessions to improve speed?
I am able to send a mail using javax.mail API. But the problem here is on an average for each mail it taking around 4.3 seconds to send to destination. If I am sending a 20 mails sequentially, it takes around 86.599 seconds. For my requirement this approach will not work. I am looking for an approach which can send
How to read text inside body of mail using javax.mail
i’m developing a client mail using javax.mail to read mail inside mail box: I know that the method getContent() returns an object cause the content could be a String, a MimeMultiPart, a SharedByteArrayInputstream and other ( i think )… Is there a way to get always the text inside body of message? Thanks!! Answer This answer extends yurin’s answer. The
Is it possible to specify multiple email addresses to receive bounce messages?
We’re using JavaMail API to send emails from our application. To handle bounce back messages (Non delivery report), we’re redirecting bounce backs to a different email address using the following code: In our case, we want bounce backs to be redirected to multiple email addresses. In fact, we even tried few other options like providing a list of addresses separated