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

Read/input email as String or Bytes format in EmailParser() class #99

Open
harshalgithub opened this issue Oct 18, 2024 · 0 comments
Open

Comments

@harshalgithub
Copy link

Hello,

Currently I can see only "EML or MSG File/FilePath" as input to parse_emails.EmailParser() function.

Is there any way to pass already read email object from default "email" library
import email
PYTHON_OBJECT = email.message_from_string(STRING_INPUT)
PYTHON_OBJECT = email.message_from_bytes(BYTES)

init(self, file_path, max_depth=3, parse_only_headers=False, file_info='', forced_encoding=None,
default_encoding=None, file_name=None, email_object=PYTHON_OBJECT)

So that we can use python memory objects to parse emails using "EmailParser()" function.

This will be useful when we use different python libraries (email / mailparser / poplib / imaplib etc) to pull live emails from inbox from any Mail Server and parse it for further processing.

Please let me know if above ask is already available in this library.

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

1 participant