Utility Features
Sending a Message with Voting Option
Microsoft Outlook allows users to create a poll when composing a new message. This is done by including voting options such as Yes, No, Maybe, etc. The FollowUpOptions class offered by Aspose.Email provides the VotingButtons property that can be used to set or get the value of the voting options. This article provides a detailed example of creating a MapiMessage with voting options for creating a poll and then sending the message using Exchange Web Service (EWS) client.
Creating and Sending a Message with Voting Options
The following code snippet shows you how to create a new message and then send it with voting options.
The following code snippet shows the definition of the CreateTestMessage method used in the above example.
Ignore or Bypass Invalid or Expired SSL Certificate
Aspose.Email can handle SSL certificates on Exchange Server by using the EWSClient class. If the SSL certificate has expired or become invalid, Aspose.Email throws an exception due to invalid SSL certificate. Avoid such SSL certificate errors by ignoring them using the method used in the code below. Register the callback handler in your main() or init() method and add the method below as the member of the class.
Creating RE and FW messages from MSG files
IEWSClient lets developers create RE (Reply/Reply All) and FW (Forward) messages from a source message. The source message is identified by selecting a particular ExchangeMessageInfo from ExchangeMessageInfoCollection obtained by ListMessages(). The other argument is the actual MailMessage to be sent as RE or FW message. The following code snippet shows you how to send a message and then reply to that message and Forward that message. To perform this task:
- Initialize the IEWSClient object by providing valid credentials.
- Send a few sample messages.
- Call the Reply(), ReplyAll() and Forward() methods to send messages.
Adding Headers in EWS Requests
Aspose.Email API allows adding headers to Exchange requests. This can be used to add headers to the EWS requests for different headers that can be used for different purposes. One such example could be adding the X-AnchorMailbox header that is used to manage the throttling issues on the Exchange server. The AddHeader method of the IEWSClient is used to add headers to the EWS requests as shown in the following code snippet.
Working with Unified Messaging
Aspose.Email can retrieve unified messaging information from Exchange Server 2010. Unified messaging such as getting configuration information, initiating an outbound call, retrieving phone call information by call ID and disconnecting a phone call by ID is supported at present. The following code sample shows how to retrieve unified messaging configuration information from Microsoft Exchange Server 2010.
Getting Mail Tips
Microsoft Exchange Server added several new features with Exchange Server 2010 and 2013. One of them lets users get mail tips when composing an email message. These tips are very useful as they provide information before the email is sent. For example, if an email address is wrong in the recipient’s list, a tip is displayed to let you know that the email address is invalid. Mail tips also let you see out of office replies before sending an email: Exchange Server (2010 & 2013) sends the mail tip when the email is being composed if one or more of the recipients have set out of office replies. Microsoft Exchange Server 2010 Service Pack 1 is required for all the features demonstrated in this article. The following code snippet shows you how to uses the EWSClient class which uses Exchange Web Services, available in Microsoft Exchange Server 2007 and later versions.