13

Wondering if this is possible. Suppose an email is written in HTML for email clients to render. And an anchor tag exists in the HTML code that is going to be parsed by the email client.

One can reference resources (images, files, etc..) externally from servers. For instance, I can do Download PDF

Is it possible to reference an attachment that was sent along with the email? So attach a PDF and have some tag in the email reference the attachment that's a part of the HTML code.

I don't really want to hear "alternative" solutions. I pretty much want to hear yes/no.

Steve Nguyen
  • 5,854
  • 5
  • 21
  • 39

2 Answers2

4

Answered in https://stackoverflow.com/a/9983277/38841

No hacks needed. Use the cid: URI scheme

Community
  • 1
  • 1
Robert J Berger
  • 890
  • 9
  • 12
  • 3
    That answer was for showing images sent as attachments (IMG tag). This question is about linking them using "A HREF". – PaulJ Dec 19 '15 at 17:24
  • It seems like in place of putting an image CID URI into a IMG tag, you should be able to reference it in a A tag like a URL. However, it does mean sending the file as part of the email in base 64 (4/3 size), so real URLs are nicer, as un-clicked links have no message size impact. Even if you have no web server, you should be able to share files using Google Drive and the like, much of that being free. Of course, they are exposed to public access, while a file embedded in an email is only shared by forwarding, disregarding the lack of security of email packets. – David G. Pickett Jun 17 '20 at 20:32
4

Nope. Each mail client takes care of attachments individually, in their own way. If you could make it work in some clients, rest would fail.

If think that there would be more problems than use.

Mārtiņš Briedis
  • 17,396
  • 5
  • 54
  • 76