N
N
Natalie L.2016-08-12 17:59:40
HTML
Natalie L., 2016-08-12 17:59:40

How to add a link to an attached file inside an email?

You need to add a link to download the attached zip archive inside the html email. Relative path "in the same folder" does not work. Is it even possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Dubrovin, 2016-08-12
@z3apa3a

For emails, a link to an attached or inline file is made via the URI cid:, cid: contains the value of the Content-ID header of the part of the email containing the attachment. for example

From: ...
Subject: test
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="123"

--123
Content-Type: text/html; charset=utf-8
...
<a href="cid:[email protected]">attached file</a>
...
--123
Content-Type: application/zip
Content-Transfer-Encoding: base64
Content-Disposition: attachment
Content-ID: <[email protected]>

....
--123--

But I would strongly not recommend doing this, because how it will work in email clients / web services is not known.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question