Python mailcap Module
Verify mailcap helpers are available:
import mailcap
print(hasattr(mailcap, "findmatch"))
Try it Yourself »
Warning: DeprecationWarning: The mailcap module is deprecated and will be removed in Python 3.13. See the mimetypes module for an alternative.
Definition and Usage
The mailcap module reads mailcap files to map MIME types to external viewers.
Members
Member | Description |
---|---|
findmatch() | Find a command to handle a given MIME type. |
getcaps() | Read the system mailcap files and return capabilities mapping. |