Extract Attached Files From Parsed Email


I have been trying to look for a way in golang to extract attached files from email.

I have a code in golang using “net/mail” package. It opens up an email file from a folder and successfully parsed the subject, body, and other info.

What I wanted to do is is if the email have any attachments I would like to extract that attachment and copy it into another folder.

How do we do this using golang? Does “net/email” package supports this kind of functionality?

I suspect you’re looking for: https://golang.org/pkg/mime/

1 Like

Thank you. Besides that is there any other working example?


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.