Aspose.Email  for Java

Java Outlook API & Java Thunderbird API For Email Processing

Generate emails, send emails & parse emails from Outlook & Thunderbird without requiring additional software. Send & Receive Emails via SMTP, POP3, IMAP protocols.

  Download Free Trial
  
 

Aspose.Email for Java allows developers to focus on implementing their own business logic for managing emails without having to know about format specifications or network programming.

Aspose.Email for Java can create Outlook emails, parse emails or convert message formats such as MSG, EML, MBOX, PST, OST & MHT from within Java applications. The API can manipulate message contents, attachments, headers, and MAPI properties as well as the capability to send and receive emails via a number of popular protocols. It also provides the ability to manage message storage documents such as Personal Storage Files PST and Offline Storage Files OST. You can list emails, extract emails, add or remove messages from storage files as per your application specifications. Java Email library allows to work with Outlook contacts file (VCF).

Advanced Email Processing API Features

Create & manipulate messages via API

Inter-convert message formats with few lines of code

Extract message header information

Add, extract & manipulate attachments

Create HTML formatted messages

Create message in draft mode (MSG only)

Traverse & read nested email attachments

Retrieve multiple recipients

Access MAPI properties

List user-created custom folders

Get folder path in OLM file

Multi-connection support for IMAP backup & restore operations

Multi-connection support for SMTP operations

Create ICF & VCF v3.0 files

Read Emails in ascending or descending order

Save MapiCalendar with HTML body format

Create & manage In-Place Archive at Office 365

Create folder hierarchy in PST using string notation

Specify creation & modify dates for ICS

Access Outlook for MacOS data file (OLM)

Configure SSL/TLS encryption on email client instances

Create contact in sub-folder of contacts at EWS

Create unified method for MAPI items fetching at EWS

Use HTTP proxy for email clients (SMTP, IMAP, POP3)

Convert Message To Different Email Formats In Java

The Java Email library 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 the API object model and call the save method with the required parameters. It is really that simple!

Emailing via SMTP, POP3 & IMAP

API enables to create and format 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("smtp.gmail.com", 587, "username", "password");

// Set Security options for the server

client.setSecurityOptions(SecurityOptions.Auto);

// Create a new 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

client.send(msg);

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 as MSG or ICS documents as well as retrieve, send, update & cancel meeting requests via message sending protocols.

Manage Message Storage Files

Aspose.Email for Java API allows managing Outlook storage formats. 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, the library 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

pst.getRootFolder().addSubFolder("Inbox");

// add message to newly created folder

pst.getRootFolder().getSubFolder("Inbox").addMessage(MapiMessage.fromFile(dir + "template.msg"));

Work With Contact Cards

Aspose.Email for Java allows to manipulate contact card files, also known as VCF or VCard which is a worldwide file format to store and exchange contacts cards. Process Outlook contact cards as well as Thunderbird VCards within Java apps. Using Aspose.Email for Java, you are able to send VCard or VCF files in email, attach VCF to your messages or extract them from emails. Also, you can exchange VCard (VCF) files in your way. The API allows to edit, create and remove your contact cards. You can easily add contact cards support to your application.

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 features, security, scalability and speed.

  
  

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