how to convert String to message in java mail api?
You can use the MimeMessage
constructor which accepts an InputStream
. (See the JavaMail documentation)
Message msg = new MimeMessage(mySession,
new ByteArrayInputStream(myString.getBytes()));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With