Does winui 3 desktop application support "Windows.ApplicationModel.Email"?

Singh Wong 51 Reputation points
2021-10-17T04:36:18.273+00:00

Hello everyone,
In uwp, using the following code to achieve the mail function works very well.

                var emailMessage = new Windows.ApplicationModel.Email.EmailMessage();  
                var email = new ContactEmail()  
                {  
                    Address = "user@hotmail.com",  
                    Description = "FeedBack",  
                };  
                if (email != null)  
                {  
                    var emailRecipient = new Windows.ApplicationModel.Email.EmailRecipient(email.Address);  
                    emailMessage.To.Add(emailRecipient);  
                    emailMessage.Subject = email.Description;  
                    emailMessage.Body = string.Empty;  
                }  
  
                await Windows.ApplicationModel.Email.EmailManager.ShowComposeNewEmailAsync(emailMessage);  

But in winui 3 desktop application, an exception will be thrown.
141055-screenshot-2021-10-17-123418.png
Does winui 3 desktop application support "Windows.ApplicationModel.Email"?

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
747 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 82,751 Reputation points
    2021-10-17T06:14:19.717+00:00

    You can see this thread and the answer from RoyLi-MSFT