Hi, I was working on a C# console application that sends email messages to a recipient using Graph API, and I needed a voting option in which the recipient can use. Was wondering if such a functionality could be added, thanks.
4 Comments
- AnnamalaiSwamyCopper Contributor
Thanks for the pointer. I tried to convert to C# equivalent, but unable to make it up. Is there any C# equivalent code available.
I tried with the following C# code, mail is sent, but Voting option is not available in the mail:
var message = new Message
{
Subject = subject,
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = htmlBody
},
//Attachments = attachments,
ToRecipients = recipients,
//SingleValueExtendedProperties = new MessageSingleValueExtendedPropertiesCollectionPage()
//{
// new SingleValueLegacyExtendedProperty()
// {
// Id = String.Format("String {{{0}}} Name {1}","66f5a359-4659-4830-9070-00047ec6ac6e","Value"),
// Value = "One" //_list //new List<string>("One","Two","Three","Four")
// }
//}
MultiValueExtendedProperties = new MessageMultiValueExtendedPropertiesCollectionPage()
{
new MultiValueLegacyExtendedProperty()
{
Id = String.Format("StringArray {{{0}}} Name {1}","66f5a359-4659-4830-9070-00047ec6ac6e","Value"),
Value = new string[]{"One","Two","Three","Four" } // _list
}
}};var sendmail = graphClient.Users[Config.UserID].SendMail(message, true);
try
{
await sendmail.Request().PostAsync();
sent = true;
}
catch (Exception ex)
{
Logger.Log("Email Cannot be sent:" + ex.Message);
}Thanks,
Annamalai
- bagervin
Microsoft
Hopefully this example is helpful.
Send exchange email with voting buttons using MS Exchange Graph API Java SDK - Stack Overflow
Barry Gervin
- AnnamalaiSwamyCopper Contributor
Hi,
Is there a way to Programmatically add the Voting options using Graph API in C#.
Thanks,
Annamalai.
- bagervin
Microsoft
Hi Abdulahi,
Outlook already has a few capabilities that would help here.
I hope this helps.
Barry Gervin