Disable body of mail in WINRT application

262 views Asked by At

I have a date picker and time picker in my app and I'm trying to send mail as described here which contains the date as well as the time in the body of the mail.

So, Now my question is how to disable the body part of the email as the user shouldn't edit the date or time once it is selected from app.

What's the point of security in this ?

Code:

var mailto = new Uri("mailto:[email protected]&subject=Date Selected :+datepicker.value+"); 
await Windows.System.Launcher.LaunchUriAsync(mailto);
2

There are 2 answers

0
HDW Production On

AFAIK you cant disable the recipient, subject or body of an email.

If you want to detect an edit, then you can add a checksum to the body.

0
Damir Arh On

The way you decided to generate the email, you don't have any control over the email client from that point on - you have called an external process and passed your parameters to it. The user could do with that email whatever he wanted or even delete it without sending, without you knowing about it. Also you are depending on the user having the system setup correctly for this link to work.

To keep control over the email you are sending you shouldn't depend on external applications, therefore the solution with sharing won't help you either, even though it's prefered in Windows Store apps over the one you are currently using.

If you really need to have the email sent unchanged, you only have two options:

  • Use a client side SMTP library for sending emails. The only one I know of for Windows Store apps was released by Limilabs. The downside is that you need to configure your app locally with SMTP server settings.
  • Send a request to a web service and send the email from there. This is probably the best approach, since it is completely under your own control and doesn't require any additional configuration on the client side.