Search within Java API
Register / Login
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
Other JSE/JEE APIs
MessagingException: IOException while sending message
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
javax.mail.Transport transport = sess.getTransport("smtp"); transport.connect(smtphost, "", ""); transport.sendMessage(msg, msg.getRecipients (Message.RecipientType.TO));
javax.mail.MessagingException: IOException while sending message; nested exception is: java.io.IOException: "text/plain" DataContentHandler requires String object, was given object of type class java.io.ByteArrayInputStream
I think this exception has something to do with the code below when I create an attachment of the uploaded file as InputStream.
MimeBodyPart mbpattach = new MimeBodyPart(); mbpattach.setFileName(upFile.getFileName()); java.io.DataInputStream ds = new java.io.DataInputStream(upFile.getInpuStream()); mbpattach.setDataHandler(new DataHandler(upFile.getInpuStream(), upFile.getContentType()));
How can I resolve this issue?
[ October 27, 2005: Message edited by: Swapan Mazumdar ]
Maybe he went home and went to bed. And took this tiny ad with him:
Thread Boost feature
Boost this thread!
java code to digitally sign and verify an email
google app engine, issues sending email attachment
JavaMail Exception "HELO requires domain address"
Having Problem in sending mail
Email Java object in memory
A JavaMail exception, can you explain?