Java Email Parsing APIs

Generate, Process and Convert Outlook formats without any Microsoft Outlook dependencies. Send and Receive Emails via SMTP,  POP3 protocols.

  Download Free Trial
Aspose.Email for Java

Aspose.Email for Java


Aspose.Email for Java is a set of email processing APIs to create, manipulate or convert message formats such as MSG, EML & MHT from within Java applications. The API provides the ability to manipulate message contents, headers, attachments and Mapi properties as well as the capability to send and receive emails via a number of popular protocols.

Aspose.Email for Java provides the ability to manage message storage files such as Personal Storage Files (PST) & Offline Storage Files (OST) thus allowing you to list, extract, add or remove messages as per your application requirements.


Advanced Email Processing API Features



Create & manipulate messages


Inter-convert message formats


Extract message header details


Extract & manipulate attachments


Create HTML formatted messages


Create message in draft mode (MSG only)


Read nested email attachments


Retrieve multiple recipients


Access MAPI properties


Get the list of user-created custom folders


Get folder path in OLM file


Multi-connection support for backup/restore IMAP operation


Multi-connection support for Send SMTP operation


Create ICF and VCF version 3.0 files


Create group fetch messages IMAP and POP3 operation


Support for Russian Culture Name: en-RU


Read Emails in descending order


Save MapiCalendar with HTML body format


Create and Manage In-Place Archive in Office 365


Create folder hierarchy in PST using string notation


Specify created and last modified dates in ICS


Support for Outlook for Mac Data File OLM


Configure SSL/TLS ecryption type on email client instances


EWS: Create contact in Sub-Folder of Contacts


EWS: Create unified method for MAPI items fetching


Use http proxy in email clients (SMTP, IMAP, POP3)


Provide MailMessage like MHT output for MapiTask

Convert MSG to Different Formats

The Java Email API provides easy-to-use interfaces for the conversion of supported message file formats. In order to perform a conversion, all you need to do is to load the source file in Aspose.Email object model and call the save method with appropriate parameters. It is really that simple!

Emailing via SMTP, POP3 & IMAP

API enables to create and format email messages, attaching files and images as well as sending it to email addresses via SMTP protocol. Another facility that API provides is logging into POP3 servers via user name & password. Via API's APOP authentication feature, it is easy to get the full message or just the headers, view mailbox size & message count, delete messages from the server and much more. Few of API supported IMAP protocol features such as authentication, create, select, remove, query folders, get and save messages and change message flags.

How to send an email using SMTP - Java

// Initialize SmtpClient object
SmtpClient client = new SmtpClient("", 587, "username", "password");
// Set Security options for the server
// Create a new Email Message
MailMessage msg = new MailMessage("This email address is being protected from spambots. You need JavaScript enabled to view it.", "This email address is being protected from spambots. You need JavaScript enabled to view it.", "First Message from Java", "Body");
System.out.println("Sending message..");		
// Send the Message now

Calendar Objects Management

Aspose.Email iCalendar API enables to create, extract and save Outlook Calendar objects in various formats. It provides the capability to save them as MSG or ICS files as well as send, retrieve, update and cancel meeting requests through message sending protocols.

Manage Message Storage Files

Aspose.Email for Java allows you to manage Outlook storage files. You can load PST & OST files from disk or a stream, get folder and sub-folder information from the message archive, retrieve message-specific details such as subject, sender, recipient and save messages to either disk or stream.

Apart from parsing an existing PST, Aspose.Email for Java also provides the means to create a PST file from scratch and add messages to any folder of it.

Create PST from scratch & add a message from file - Java

// create an instance of PersonalStorage
PersonalStorage pst = PersonalStorage.create(dir + "archive.pst", 0);
// create a folder at the root of PST
// add message to newly created folder
pst.getRootFolder().getSubFolder("Inbox").addMessage(MapiMessage.fromFile(dir + "template.msg"));

Microsoft Office Automation – Not Needed

Aspose.Email for Java is built using managed code that does not need Microsoft Office or Microsoft Outlook to be installed on the machine to work with emails processing. It is a perfect Microsoft Outlook automation alternative in terms of supported features, security, stability, scalability, speed and price.


Support and Learning Resources


Aspose.Email offers individual Email APIs for other popular development environments as listed below: