0

I would like to add a non-editable text block with some text in it to mail body. Is it possible to do so as shown in this sample project. If so how do I add the non-editable text to the body of mail So far to send the mail I have this code provided:

var mailto = new Uri("mailto:?to=recipient@example.com&subject=The subject of an email&body=Hello from a Windows 8 Metro app."); 
await Windows.System.Launcher.LaunchUriAsync(mailto);
coder
  • 13,002
  • 31
  • 112
  • 214
  • 2
    You're launching the mail via `mailto`, which relies on a system installed mail handler - as such, it's up to that program whether to allow that text to be edited, and most (all?) mail programs will let the user change any text in the body. I don't think this is possible. – Reed Copsey Sep 02 '13 at 19:41
  • @ReedCopsey-Yes I agree but this windows 8.1 dosen't have any smtp.net namespace to send mails directly..So I thought of doing something crap so that I need to get the details which is populated by my app.And I have seen Limilabs dll which worked perfectly..but that's not free..So any other way to get the details..As I have a date picker and timepicker in my app...Once the user selects the same should reflect in mail body..And he can do any sort of modificatons in his mail..That makes me to think... – coder Sep 02 '13 at 19:45
  • How is this different than the last time you asked it? http://stackoverflow.com/questions/18568679/disable-body-of-mail-in-winrt-application – WiredPrairie Sep 02 '13 at 20:30
  • Either **allow the user to be in control of their e-mails**, buy a component, or use a service that allows you to send an e-mail via a web service call. – WiredPrairie Sep 02 '13 at 20:32
  • And if it did have smtp namespace, what would you use as the smtp host without end-user configuration? – WiredPrairie Sep 02 '13 at 20:34
  • Are you sending the mails as HTML? You can add a `user-select: none;` CSS property. This will disable selection in the HTML. – thomaux Sep 03 '13 at 09:22

1 Answers1

0

How about creating an image of the (readonly) text and add that to the email.

&attachment="/path/file.jpg"

I've definitely coded worse bodges ;)

Or maybe using mime ...

Create am image somthing like this :

Bitmap bm = new Bitmap(100, 100);
using (Graphics g = Graphics.FromImage(bm))
    g.DrawString("some text", SystemFonts.DefaultFont, Brushes.Black, 0, 0);

bm.Save( .... );
mp3ferret
  • 1,183
  • 11
  • 16