Hello Kashif, I downloaded trial version of Aspose.Email for Java. My goal is to find out if this library will let me to preset outlook e-mail in java code and open it right from application as Outlook message. I was able to use your demo code to save msg file on the network drive, but can’t find the way to open it right from the app. Here is what I did, following your example and demo code:
// Create a new instance of MailMessage class
MailMessage message = new MailMessage(); // Set sender information message.setFrom(new MailAddress(“from@domain.com”, “Sender Name”, false)); // Add recipients message.getTo().add(new MailAddress(“to1@domain.com”, “Recipient 1”, false)); message.getTo().add(new MailAddress(“to2@domain.com”, “Recipient 2”, false)); // Set subject of the message message.setSubject(“New message created by Aspose.Email for Java”);
// Set Html body
message.setHtmlBody(“This line is in bold. ” + “This line is in blue color”);
// create instance of type MapiMessage from MailMessage MapiMessage mapiMsg = MapiMessage.fromMailMessage(message); // set message flag to un-sent mapiMsg.setMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT); // save it - Here you can save it to Memorystream in editable mode now. OutputStream ms = new ByteArrayOutputStream(); mapiMsg.save(ms);
I saw your example in
vb.net
, could you provide the same example in java? This function is the trigger for making a decision of buying this product or not. Thank you. This message was posted using Email2Forum by kashif.iqbal.