This technical tip explains how to create & send an email message with voting options inside .NET Applications. Microsoft Outlook allows users to create a poll when composed 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 sample shows how to create a new message and then send it with voting options.
[C#]
}
[VB.NET]
[C#]
}
[VB.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.
Creating and Sending a Message with Voting Options
The following code sample shows how to create a new message and then send it with voting options.
[C#]
string address = "firstname.lastname@aspose.com";
using (IEWSClient client = EWSClient.GetEWSClient("https://exchange.aspose.com/ews/Exchange.asmx", "username", "password", "aspose.com"))
{
MailMessage message = CreateTestMessage(address);
{
MailMessage message = CreateTestMessage(address);
FollowUpOptions options = new FollowUpOptions();
options.VotingButtons = "Yes;No;Maybe;Exactly!";
client.Send(message, options);options.VotingButtons = "Yes;No;Maybe;Exactly!";
}
[VB.NET]
Dim address As String = "firstname.lastname@aspose.com"
Using client As IEWSClient = EWSClient.GetEWSClient("https://exchange.aspose.com/ews/Exchange.asmx", "username", "password", "aspose.com")
Dim message As MailMessage = CreateTestMessage(address)
Dim message As MailMessage = CreateTestMessage(address)
Dim options As New FollowUpOptions()
options.VotingButtons = "Yes;No;Maybe;Exactly!"
options.VotingButtons = "Yes;No;Maybe;Exactly!"
client.Send(message, options)
End Using
Sample Methods Used in ExamplesEnd Using
[C#]
private static MailMessage CreateTestMessage(string address)
{
MailMessage eml = new MailMessage(
address,
address,
"Flagged message",
"Make it nice and short, but descriptive. The description may appear in search engines' search results pages...");
return eml;{
MailMessage eml = new MailMessage(
address,
address,
"Flagged message",
"Make it nice and short, but descriptive. The description may appear in search engines' search results pages...");
}
[VB.NET]
private static MailMessage CreateTestMessage(string address)
{
MailMessage eml = new MailMessage(
address,
address,
"Flagged message",
"Make it nice and short, but descriptive. The description may appear in search engines' search results pages...");
{
MailMessage eml = new MailMessage(
address,
address,
"Flagged message",
"Make it nice and short, but descriptive. The description may appear in search engines' search results pages...");
return eml;
}
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.
- Homepage of Aspose.Email for .NET
- Download Aspose.Email for .NET
No comments:
Post a Comment