I just tested the 4.0.0 version.
It is not correct to convert to mhtml format.
The on behalf of should be in the from line, not top position.
also 4.0.0 changed some code from 3.9.0.
you should let us know what codes are changed.
We can’t send this email file because of company policy.
Please let me know.
Thanks,
Chang Shin
Hi Chang,
- MapiTask.getReminderFileParameter(
- MapiTask.getReminderSet()
- MapiTask.getReminderTime()
- MapiTask.setReminderFileParameter(java.lang.String)
- MapiTask.setReminderSet(boolean)
- MapiTask.setReminderTime(java.util.Date)
- MailMessageSaveOptions.NoEncodeCharactersToMht
- FolderInfo.getContents(com.aspose.email.MailQuery)
- FolderInfo.addFile(java.lang.String,java.lang.String)
- FolderInfo.getSubFolders(com.aspose.email.MailQuery)
I just tested 4.1.0 email version. The mhtml format is ok.
but this code still has top extra line:
com.aspose.words.Document document = new com.aspose.words.Document(baseFolder + htmlFileName);
document.save(baseFolder +“temp/” + tempPdfFileName, SaveFormat.PDF);
The email sample file is attached.
Thanks,
Chang Shin
The issues you have found earlier (filed as NETWRKJAVA-33366) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi Chang,
String dir = “EMAIL_544635\”;<o:p></o:p>
MailMessage msg = MailMessage.load(dir + "Declined Ingersoll-Rand Company Limited @ Mon Feb 24 2014 12pm - 1pm (changsub shin@gmail com).msg");
int saveOptions = MailMessageSaveOptions.WriteHeaderToMht | MailMessageSaveOptions.HideExtraPrintHeader;
msg.save(dir + "output.mhtml", MailMessageSaveType.getMHtmlFormat() ,saveOptions);
com.aspose.words.Document document = new com.aspose.words.Document(dir + "output.mhtml");
document.save(dir + "output.pdf",
SaveFormat.PDF);
The MHTML file is ok with or without this option MailMessageSaveOptions.HideExtraPrintHeader . But the document.save does not work.
I am using java total version and the word version is “aspose-words-14.4.1-jdk16.jar”.
//message.save](https://message.save/)(baseFolder + htmlFileName, MailMessageSaveType.getMHtmlFormat(), MailMessageSaveOptions.HideExtraPrintHeader);
message.save(baseFolder + htmlFileName, MailMessageSaveType.getMHtmlFormat(), MailMessageSaveOptions.None);
com.aspose.words.Document document = new com.aspose.words.Document(baseFolder + htmlFileName);
document.save(baseFolder +“temp/” + tempPdfFileName, SaveFormat.PDF);
The MHTML and the final pdf file are attached.
Thanks,
Chang Shin
Hi Chang,
String dir = “EMAIL_544635\”;<o:p></o:p>
MailMessage msg = MailMessage.load(dir + "Declined Ingersoll-Rand Company Limited @ Mon Feb 24 2014 12pm - 1pm (changsub shin@gmail com).msg");
int saveOptions = MailMessageSaveOptions.WriteHeaderToMht | MailMessageSaveOptions.HideExtraPrintHeader | MailMessageSaveOptions.WriteCompleteEmailAddressToMht;
msg.save(dir + "output.mhtml", MailMessageSaveType.getMHtmlFormat() ,saveOptions);
com.aspose.words.Document document = new com.aspose.words.Document(dir + "output.mhtml");
document.save(dir + "output.pdf", SaveFormat.PDF);
Getting worse. The headers are created twice.
I told you the mhtl is ok with “message.save(baseFolder + htmlFileName, MailMessageSaveType.getMHtmlFormat(), MailMessageSaveOptions.None);” code.
but com.aspose.words.Document document = new com.aspose.words.Document(baseFolder + htmlFileName);
document.save(baseFolder +“temp/” + tempPdfFileName, SaveFormat.PDF);
has the extra line.
These are Aspose libraries I use.
Thanks,
Chang Shin
Hi Chang,
I can’t upload the sample java project due to this your server error:
The Eclipse java project zip file size is almost 60 MB.
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Thanks,
Chang Shin
Hi Chang,
Please use this URL to download project jar file.https://drive.google.com/file/d/0B-WiRoVbQllgaGloV0kzTWIyMWc/edit
Thanks,
Chang Shin
Hi Chang,
Thank you for your patience and providing the sample project.
I have tested your sample code and modified it slightly to hide the extra header in the resultant PDF. Could you please give it a try and let us know your feedback?
String baseFolder = “D:/Aspose/”;
String msgFileName = “Declined.msg”;
String htmlFileName = “Declined.mhtml”;
String pdfFileName = “Declined.pdf”;
MailMessageLoadOptions loadOptions = new MailMessageLoadOptions();
loadOptions.setMessageFormat(MessageFormat.getMsg());
MailMessage message = MailMessage.load(baseFolder + msgFileName, loadOptions);
TimeZone timezone = TimeZone.getTimeZone(“America/Los_Angeles”);
double offset = timezone.getOffset(Calendar.ZONE_OFFSET);
// checking offset value for date
Calendar c = Calendar.getInstance(timezone); // omit timezone for default tz
c.setTime(message.getDate()); // your date; omit this line for current date
int dateOffsetInt= c.get(Calendar.DST_OFFSET);
int offSetint = Double.valueOf(offset).intValue()+dateOffsetInt;
offset = Double.parseDouble(offSetint + “”);
message.setTimeZoneOffset(offset);
MhtMessageFormatter mhtlFormat = new MhtMessageFormatter();
mhtlFormat.setDateTimeFormat(“EEEE, MMMM dd, yyyy hh:mm:ss a”);
//Changes Start
int formatOptions = MhtFormatOptions.HideExtraPrintHeader | MhtFormatOptions.WriteCompleteEmailAddressToMht;
mhtlFormat.format(message, formatOptions);
//mhtlFormat.format(message);
//Changes End
message.save(baseFolder + htmlFileName, MailMessageSaveType.getMHtmlFormat(), MailMessageSaveOptions.None);
com.aspose.words.Document document = new com.aspose.words.Document(baseFolder + htmlFileName);
document.save(baseFolder + pdfFileName, com.aspose.words.SaveFormat.PDF);
System.out.println(“it is done.”);
Hi Chang,
I created the thread for Words team. but I can’t understand why I have to create a new thread for Words team. you are same company.
Thanks,
Chang Shin
Hi Chang,
Hi Chang,
This issue has been logged into our issue tracking system as WORDSNET-10159. We will keep you updated on this issue in this thread. Sorry for the inconvenience.
Best Regards,
We still have this issue regarding "on behalf of"
The sample message file is ok. but some email message file has “on behalf of"
I use 'aspose-email-4.1.0.0-jdk16.jar”.
We can’t share the email message file because of company policy.
Thanks,
Chang Shin
Hi Chang,