Aspose.Email  for Java

Bulk Report Generation in EML Format via Java

Generate EML email messages in bulk without requiring Outlook or Thunderbird.

How to Generate EML Reports Using Java

In order to create EML file reports, we’ll use

Aspose.Email for Java

API which is a feature-rich, powerful and easy to use assembly API for Java platform. You can download its latest version directly from


and install it within your Maven-based project by adding the following configurations to the pom.xml.


<name>Aspose Java API</name>
<version>version of aspose-email API</version>

Steps to Generate EML Reports via Java

  1. Create a template from MailMessage
  2. Add dynamic fields for Subject, To, From & HtmlBody fields
  3. Create a TemplateEngine using the MailMessage object
  4. Create data source and mapping to the template fields
  5. Create messages in bulk using TemplateEngine.Instantiate method
  6. Save messages in EML format

System Requirements

Aspose.Email for Java supports on all major platforms and Operating Systems. Please make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible OS with Java Runtime Environment for JSP/JSF Application and Desktop Applications.
  • Get latest version of Aspose.Email for Java directly from Maven.

Generate eml_Upper Messages in Bulk - C#

//create a new MailMessage instance as a template
MailMessage template = new MailMessage();

//add template field to subject
template.setSubject("Hello, #FirstName#");
template.setFrom(MailAddress.to_MailAddress("This email address is being protected from spambots. You need JavaScript enabled to view it."));

//add template field to receipt
template.getTo().addMailAddress(new MailAddress("#Receipt#", true));

//add template field to html body 
//use GetSignment as the template routine, which will provide the same signment.
template.setHtmlBody("Dear #FirstName# #LastName#, Thank you for your interest in Aspose.Network.Have fun with it.#GetSignature()#");

//create a new TemplateEngine with the template message.
TemplateEngine engine = new TemplateEngine(template);

//fill a DataTable as data source
DataTable dt = new DataTable();
DataRow dr;
dr = dt.newRow();
dr.set("Receipt", "Nancy.Davolio");
dr.set("FirstName", "Nancy");
dr.set("LastName", "Davolio");
dr = dt.newRow();
dr.set("Receipt", "Andrew.Fuller");
dr.set("FirstName", "Andrew");
dr.set("LastName", "Fuller");
dr = dt.newRow();
dr.set("Receipt", "Janet.Leverling");
dr.set("FirstName", "Janet");
dr.set("LastName", "Leverling");

MailMessageCollection messages;
	//create the messages from the template and datasource.
	messages = engine.instantiate(dt);
}catch (MailException ex){
	//print exception
  • About Aspose.Email for Java API

    Aspose.Email is a Microsoft Outlook and Thunderbird formats parsing solution. One can easily create, manipulate, convert email and storage formats such as MSG, EMLX, EML and MHT. Handling of email attachments, customization of message headers and implementation of different network protocols like POP3, IMAP & SMTP to send & receive emails is much easier. Its a standalone API and does not require Microsoft Outlook or any other software installation.

    Free App to Assemble EML

    Check our live demos to create EML files with following benefits.

      No need to download or setup anything
      No need to write or compile code
      Just upload EML file and hit the "Assemble" button
      Download the resultant EML file from the link

    EML What is EML File Format

    EML file format represents email messages saved using Outlook and other relevant applications. Almost all emailing clients support this file format for its compliance with RFC-822 Internet Message Format Standard. Microsoft Outlook is the default software for opening EML message types. EML files can be used for saving to disc as well as sending out to recipients using communication protocols.

    Read More

    Other Supported Report Generation Formats

    Using Java, one can easily generate reports of multiple formats including.

    MBOX (Electronic Mail Messages)
    MSG (Outlook & Exchange Format)
    OST (Offline Storage Files)
    PST (Outlook Personal Storage Files)