Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachments Content-Disposition #68

Open
undead85 opened this issue Apr 13, 2012 · 5 comments
Open

Attachments Content-Disposition #68

undead85 opened this issue Apr 13, 2012 · 5 comments

Comments

@undead85
Copy link

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

@537mfb
Copy link

537mfb commented Apr 16, 2012

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?

@angraxs2
Copy link

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

@537mfb
Copy link

537mfb commented May 23, 2012

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

@jstedfast
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@jstedfast @537mfb @undead85 @angraxs2 and others