Closed dilumonjames93 closed 6 months ago
- add jakarta.mail-api-2.1.2.jar dependancy to the class
There are 4 jars that have to be added:
angus-activation-XXX.jar,
angus-mail-XXX.jar
jakarta.mail-api-XXX.jar
jakarta.activation-api-XXX.jar
Not provider of jakarta.mail.util.StreamProvider was found is due to only adding the API and not the implementation.
@jmehrens is right - as of 2.1.2, the implementation is not part of the API jar, one has to explicitly which implementation to use, one example can be Angus Mail, which is the follower of the JavaMail/JakartaMail implementation
Describe the bug Getting below Exception while calling MimeUtility.encodeText(inputText, "UTF-8", null); with Japanese alphabets
English words are working fine.
Exception in thread "main" java.lang.IllegalStateException: Not provider of jakarta.mail.util.StreamProvider was found at jakarta.mail.util.FactoryFinder.find(FactoryFinder.java:64) at jakarta.mail.util.StreamProvider.provider(StreamProvider.java:177) at jakarta.mail.internet.MimeUtility.doEncode(MimeUtility.java:824) at jakarta.mail.internet.MimeUtility.encodeWord(MimeUtility.java:750) at jakarta.mail.internet.MimeUtility.encodeText(MimeUtility.java:527)
To Reproduce Steps to reproduce the behavior:
import jakarta.mail.internet.MimeUtility; import java.io.UnsupportedEncodingException;
public class MimeUtilityExample { public static void main(String[] args) { String inputText = "人件費予算売上リキャッフ"; // Replace with your text try { String encodedText = MimeUtility.encodeText(inputText, "UTF-8", null); System.out.println("Encoded Text: " + encodedText); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } }
Expected behavior it should encode the string successfully
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Mail server:
Additional context Add any other context about the problem here.