开发者

email MIME Content-Disposition hyperlink

开发者 https://www.devze.com 2022-12-22 16:09 出处:网络
开发者_如何学JAVAHi i an building an mbox file from a db blob and would like to add an hyperlink to the Attachement header
开发者_如何学JAVA

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号