Search code examples
c#apiwindows-store-apps

How to share a text to mail in Window Store App?


I want to share a text via mail in windows store app. Can anyone please suggest me a coding?


Solution

  •  public softDrinkProductDet()
        {
            this.InitializeComponent();
            DataTransferManager dfm = DataTransferManager.GetForCurrentView();
            dfm.DataRequested += dfm_DataRequested;
        }
    
        void dfm_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
        {
            DataRequest dr = args.Request;
            dr.Data.Properties.Title = "Your Title";
            dr.Data.Properties.Description = "Description";
    
            dr.Data.SetText("Some Shareing");
        } 
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            DataTransferManager.ShowShareUI();
        }
    

    Thanks & Regards,