We are trying to generate an html unicode Microsoft Office Outlook email (.msg) that users can still edit in Outlook before sending it.
This works fine except when manually adding an image from a file into the body of the generated email.
This is done using the Outlook Menu: Insert > Image > From file.
In Outlook 2003:
- either the message can’t be send because we get the error dialog “Unspecified error” (in Dutch)
- or the image is not included when the mail is sent.
- The image is sent as an attachment and is not inline anymore.
- If we manually add a random attachment to the generated email and keep or remove this attachment, the problem is solved (but this is not a workaround).
- If I add an attachment automatically in the generation, the problem remains.
- If we copy/paste an image into the body using the
clipboard instead of inserting it from a file, there is no problem (but
this is not a workaround).
I assume that a sort of header is missing that is corrected when an attachment is added manually.
I tried the Aspose.Network (2.2.0 and 2.3.0) and the Aspose.Email 1.0.0 library for Java and this is the example code you can use to simulate the problem:
MailMessage message = new MailMessage();
message.setSubject(“Mail creation (unicode: èçü)”);
MapiMessage mapiMsg = MapiMessage.fromMailMessage(message,OutlookMessageFormat.UNICODE);
mapiMsg.setMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT | MapiMessageFlags.MSGFLAG_FROMME);
File tempFile = File.createTempFile(“mail”, “.msg”);
FileOutputStream outputStream = new FileOutputStream(tempFile);
System.out.println("created msg: "+tempFile.getAbsolutePath());
If you then open this .msg with Outlook, insert an image from file and send it, the problem occurs.
We really need this fixed because our users will not be aware that their included images will not be sent and received.