Sunday, April 27, 2014

Set Reminder information to MapiTask & Adding Files to PST in Java Apps

What’s new in this release?

We are pleased to announce the new release of Aspose.Email for Java 4.0.0. This release not only fix the issues that our customers reported for the previous version, but also include a number of enhancements as well. Aspose.Email for Java already supported creating, saving and updating an Outlook Task. Microsoft Outlook allows adding reminder information to the created task which then triggers at the specified time and reminds the user for the activity. This month’s release of Aspose.Email for Java further enhances the MapiTask properties by providing support for adding reminder information to the created task. This includes setting reminder time for the task, specifying the audible file name that is played as reminder and reading reminder information from a MapiTask.  Aspose.Email provides vast variety of operations when it comes to work with Personal Storage (PST) files. Talking about the list of items that can be added to a PST file, it already supports adding messages, tasks, journal and notes to the PST file. This month’s release introduces a new feature of adding files to a PST folder in addition to the above mentioned Outlook items. Similar to Outlook, our API now allows to adding files to a PST and that too without installing Microsoft Outlook. In addition to the enhancements, this month’s release also includes a number of bug fixes related to message encoding, message attachments, message conversions to other formats and PST. The main improved features & bug fixes added in this release are listed below
  • Add any files (not only messages) to PST same like Microsoft Outlook.
  • Implement search of messages or folders in the PST file on certain criteria
  • Possibility to produce MHT files that use the 7-bit encoding format
  • Adding Reminder information to MapiTask
  • On Behalf of now displayed in conversion to mhtml
  • EML to XPS, Time displayed in GMT
  • PR_BODY garbled when EML converted to MSG
  • PR_BODY lost is fixed when MSG converted from EML is dragged to Outlook
  • Embedded Attachment Name is now retrieved using ImapClient
  • Issue is resolved with TNEF format
  • Incorrect conversion is fixed from EML to MSG.
  • Attachment Name now read by latest version of Aspose.Email API
  • EML to MSG: Saved MSG can now be opened in Outlook
  • HTML body lost is fixed during EML to MSG conversion
  • EML to MHTML: Attachment name absent is resolved in output
  • Setting Html body in Outlook mapi message now working with latest version
  • EML to PST: Messages are now visible in Outlook
  • Adding files to PST
Other most recent bug fixes are also included in this release.

Overview:Aspose.Email for Java 

Aspose.Email for Java is a Non-Graphical Java component that enables Java applications to read and write Microsoft Outlook documents without utilizing Microsoft Outlook. It enables developers to create new MSG file from scratch, update an existing MSG file, read Outlook MSG file & get it's properties like subject, body, recipients in to, cc and bcc, Adding or removing attachment, sender information and MAPI properties.  Aspose.Email for Java can be used with Web as well asDesktop Application.

Tuesday, April 15, 2014

Change Color Space of PDF Document & Export PDF Bookmarks to XML File

Aspose.Email lets developers manage attachments with email messages using the MailMessage and MapiMessage class. Microsoft Outlook allows you to add as well as retrieve attachments from calendar items, that is ICS. This article shows how the same can be achieved using Aspose.Email for Java for ICS files. Aspose.Email provides an attachments collection that can be used to add and retrieve attachments associated with calendar items. This article shows how to:
  • Create and add attachments to an Appointment class object.
  • Retrieve attachments information an appointment.
  • Extract attachments from an appointment.
Sample Code for Adding and Retrieving Attachments from Calendar Items
[Java]
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
calendar.set(2012, Calendar.NOVEMBER, 1, 0, 0, 0);
Date startDate = calendar.getTime();
calendar.set(2012, Calendar.DECEMBER, 1);
Date endDate = calendar.getTime();

MailAddressCollection attendees = new MailAddressCollection();
attendees.add(new MailAddress("attendee_address@domain.com", "Attendee"));
WeeklyRecurrencePattern expected = new WeeklyRecurrencePattern(3);

Appointment app = new Appointment("Appointment Location", "Appointment Summary", "Appointment Description",
                                                                                                            startDate, endDate,
                                                                                                            new MailAddress("organizer_address@domain.com", "Organizer"), attendees, expected);

//Attach a file from disc to this appointment
File file = new File("OutputXLS.xls");
FileInputStream fis = new FileInputStream(file);

Attachment att = new Attachment(fis, file.getName());
app.getAttachments().add(att);
fis.close();
String savedFile = "appWithAttachments.ics";
app.save(savedFile, AppointmentSaveFormat.Ics);

Appointment app2 = Appointment.load(savedFile);
System.out.println("Total Attachments: "  + app2.getAttachments().size());
for (int i=0; i< app2.getAttachments().size();i++)
{
            att = app2.getAttachments().get(i);
            System.out.println(att.getName());

        //Save the attachment to disc
        att.save(att.getName());
}

Overview: Aspose.Email for Java

Aspose.Email for Java is a Non-Graphical Java component that enables Java applications to read and write MS Outlook MSG files from within a Java application without using MS Outlook. It enables developers to create new MSG file from scratch, update an existing MSG file, read Outlook MSG file & get its properties like subject, body, recipients in to, cc and bcc, adding or removing attachment, sender information & MAPI properties.  Aspose.Email can be used with Web as well as Desktop Application.

Tuesday, April 8, 2014

How to Send Email Messages using Exchange Server & Exchange Web Services

This technical tip explains how to send email messages using exchange server & exchange web services inside .NET applications. You can send email messages using Exchange Server with the help of the tools in the Aspose.Email.Exchange. The ExchangeClient.Send() method accepts a MailMessage instance as a parameter and sends the email. Please follow the following steps to send emails using Exchange Server:
  • Create an instance of the ExchangeClient class.
  • Specify server name, username, password and domain.
  • Create an instance of the MailMessage class.
  • Specify the from, to, subject and other MailMessage properties.
  • Call the ExchangeClient.Send() method to send the email.
The sample code below sends email messages using Exchange Server.
[C# Code Sample]
// Create instance of ExchangeClient class by giving credentials
ExchangeClient client = new ExchangeClient("http://MachineName/exchange/username",
    "username", "password", "domain");
// Create instance of type MailMessage
MailMessage msg = new MailMessage();
msg.From = "sender@domain.com";
msg.To = "recipient@ domain.com ";
msg.Subject = "Sending message from exchange server";
msg.HtmlBody = "<h3>sending message from exchange server</h3>";
// Send the message
client.Send(msg);


[VB.NET]
‘Create instance of ExchangeClient class by giving credentials
Dim client As ExchangeClient = New ExchangeClient("http://MachineName/exchange/username", "username", "password", "domain")
' Create instance of type MailMessage
Dim msg As MailMessage = New MailMessage()
msg.From = "sender@domain.com"
msg.To = "recipient@ domain.com "
msg.Subject = "Sending message from exchange server"
msg.HtmlBody = "<h3>sending message from exchange server</h3>"
' Send the message
client.Send(msg)
Send Email using Exchange Web Services
Aspose.Email provides the ExchangeWebServiceClient class to connect to Microsoft Exchange Server using Exchange Web Services. The code snippets that follow use EWS to send emails using Microsoft Exchange Server.
[C# Code Sample]
// Create instance of IEWSClient class by giving credentials
IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
// Create instance of type MailMessage
MailMessage msg = new MailMessage();
msg.From = "sender@domain.com";
msg.To = "recipient@ domain.com ";
msg.Subject = "Sending message from exchange server";
msg.HtmlBody = "<h3>sending message from exchange server</h3>";
// Send the message
client.Send(msg);


[VB.NET Code Sample]
' Create instance of EWSClient class by giving credentials
Dim client As IEWSClient = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain")
' Create instance of type MailMessage
Dim msg As MailMessage = New MailMessage()
msg.From = "sender@domain.com"
msg.To = "recipient@ domain.com "
msg.Subject = "Sending message from exchange server"
msg.HtmlBody = "<h3>sending message from exchange server</h3>"
' Send the message
client.Send(msg)
Overview: Aspose.Email for .NET
Aspose.Email for .NET is a set of components allowing developers to easily implement email functionality within their ASP.NET web applications, web services & Windows applications. It Supports Outlook PST, EML, MSG & MHT formats. It allows developers to work with SMTP, POP3, FTP & MS Exchange servers. It supports mail merge, iCalendar, customized header & body, header information, embedded files, Twitter & many more. It makes it easy to work with HTML or plain text emails & their attachments.