I would like to append a small message stating how the message to a user was sent when one chooses to use the SMSComposeTask or EmailComposeTask in my application. I would like it to say something like "sent from" + my application name but I am not sure how to navigate to the end of the user’s message and then add my text. So far I’ve just navigated down a couple of lines and added it manually, but I would like to go to the next line and state the message to save the user from possibly sending multiple text messages once the 160 character limit is reached.
MainPage.xaml.cs
private void Messaging_Click(object sender, RoutedEventArgs e) {
SmsComposeTask smsComposeTask = new SmsComposeTask();
smsComposeTask.To = "";
smsComposeTask.Body = "Check out this application!" + "\n\n" + "sent from " + "QuickStarts";
smsComposeTask.Show();
}
private void Email_Click(object sender, RoutedEventArgs e) {
EmailComposeTask emailComposeTask = new EmailComposeTask();
emailComposeTask.Subject = "Share from " + "QuickStarts";
emailComposeTask.Body = "Check out this application!" + "\n\n" + "sent from " + "QuickStarts";
emailComposeTask.To = "";
emailComposeTask.Cc = "";
emailComposeTask.Bcc = "";
emailComposeTask.Show();
}
Once you’ve shown the SmsComposeTask or the EmailComposeTask, you have no control whichever on what the user will type. The best you can do is showing a textbox in your application so the user can type its message, then append your “sent from” text, doing every check you need, and only then show the task. But the user will still be able to change the message afterward.