1

enter image description here

When I use Microsoft Outlook, it allows me to place file attachments in the body of the email rather than just attach them to the message. Is there a way to replicate this behavior using an HTML formatted email in C#? I am sending an automated email out with lots of attachments and it would help keep everything organized for the end user. I found ways to embed an image file into the email but not how to put attachments in. I believe these are called "inline" or "embedded" attachments.

Camilo Terevinto
  • 31,141
  • 6
  • 88
  • 120
Super1337
  • 226
  • 1
  • 8
  • 1
    Possible duplicate of [Send inline image in email](https://stackoverflow.com/questions/18358534/send-inline-image-in-email) – Greg Mar 28 '18 at 23:26
  • That is close to what I am trying to do but not quite. That is to embed an image into the body... I.E. to show a JPG in when the user opens the email. I am trying to attach PDF files in the body of the email (similar to the image attached to my question). Outlook does this when you drag a file onto the body of the email. – Super1337 Mar 28 '18 at 23:38
  • 1
    I think that's governed by the email format, RTF vs. HTML. I can see in your screenshot that your example is RTF-formatted. Can you duplicate that behavior manually in an HTML-formatted email? – ejohnson Mar 29 '18 at 03:50

1 Answers1

1

No, HTML will only let you have embedded images.
RTF actually inserts icons inside special placeholders in the RTF body. The icon position is specified by the Position parameter when calling Attachments.Add.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78