Home > Code > C# > How to Create & Send Email Message with Voting Options inside .NET Apps

How to Create & Send Email Message with Voting Options inside .NET Apps

by sher azam   on Jun 03, 2014   Category: C#   |  Views: 2629    |  Points: 25   |  Gold 


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#]

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);

FollowUpOptions options = new FollowUpOptions();
options.VotingButtons = "Yes;No;Maybe;Exactly!";

client.Send(message, options);
}



[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 options As New FollowUpOptions()
options.VotingButtons = "Yes;No;Maybe;Exactly!"

client.Send(message, options)
End Using



Sample Methods Used in Examples

[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;
}



[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...");

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.

More about Aspose.Email for .NET

- Homepage of Aspose.Email for .NET: http://www.aspose.com/.net/email-component.aspx

- Download Aspose.Email for .NET: http://www.aspose.com/community/files/51/.net-components/aspose.email-for-.net/default.aspx



Post Code  |  Code Snippet Home

User Responses


No response found, be the first to review this code snippet.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts