aenetmail icon indicating copy to clipboard operation
aenetmail copied to clipboard

Attachments Content-Disposition

Open undead85 opened this issue 13 years ago • 5 comments

Some email don't have Content-Disposition and i cant get attachments.

undead85 avatar Apr 13 '12 20:04 undead85

Check Content-Description and Content-ID (message.Attachments.Headers["Content-Description"] and message.Attachments.Headers["Content-ID"])

Either one of those usually gets me the filename You will have to parse them looking for something like name="filename.ext" Can you work with those instead?

537mfb avatar Apr 16 '12 15:04 537mfb

I am also having this trouble and this workaround didn´t work neither because there is no message.Attachments.Headers

angraxs2 avatar May 23 '12 11:05 angraxs2

each attachment has a Headers (Or used to anyway - am not using the latest version yet) don't have my code at hand just now but use something like:

foreach(Attachement a in message.Attachements)
    MessageBox.Show(a.Headers["Content-Description"]);

There also used to be a RawHeaders that was better than Headers although you would have to parse the value yourself

537mfb avatar May 23 '12 15:05 537mfb

Not all MIME parts are guaranteed to have a Content-Disposition header. MIME parts don't even necessarily need to have any headers at all. This is all explained in the rfcs...

jstedfast avatar Jan 11 '14 17:01 jstedfast