Thank you for contacting Aspose Support team.
Please use the following sample code to get started with the API. We have updated the documentation sample to the latest API code for reference. Please try the code at your end and let us know your feedback if you face some problem.
String strBaseFolder = “C:\Lap_C_Drive\APOSEMAILS”;
System.out.println(“Creating new messages…”);
MailMessage message = new MailMessage();
message.setFrom(new MailAddress("email@example.com", “Atul Singh”, false));
message.getTo().addItem(new MailAddress("firstname.lastname@example.org", “Atul Singh”));
message.getTo().addItem(new MailAddress("email@example.com", “ATUL2”, false));
message.setSubject(“New message created by Aspose.Email for Java”);
message.setHtmlBody("This line is in bold.
“This line is in blue color”);
message.save(strBaseFolder + “Message.eml”, SaveOptions.getDefaultEml());
message.save(strBaseFolder + “Message.msg”, SaveOptions.getDefaultMsg());
message.save(strBaseFolder + “Message.mhtml”, SaveOptions.getDefaultMhtml());
System.out.println(“Messages created successfuly”);
Thank you so much.
Thank you for your feedback. We update the documentation from time to time with every release. One such activity is currently under process to update obsolete code samples. Please feel free to contact us in case you have any further query related to the API.