Hi i an building an mbox file from a db blob and would like to add an hyperlink to the Attachement header
I am building the header like this
msg=email.message_from_string(blob)
msg["Content-Disposition"]="attachment; filename=filename.txt;"
What do i need to add to add a http or ftp hyperlink for the filename?
If the attachment is MIME encoded along with the message, you can't have an http/ftp hyperlink, because the file does not reside on any FTP or HTTP server.
There is a way to do what you want. Look at Section 7.3.3 in RFC 1521, which defines the external-body
subytpe:
Content-Type: message/external-body;
name="logo.png";
site="ftp.example.com";
access-type=ANON-FTP;
directory="pub";
mode="image";
expiration="Fri, 13 Jun 2013 19:13:15 -0400 (EDT)"
It allows data to be pulled from a variety of external sources.
http://www.ietf.org/rfc/rfc1521.txt
精彩评论