Skip to content

ajbgm/AzureFunctionApp-ExtractAttachments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Attachment Extractor Azure Function

This Azure Function processes .eml files and extracts attachments from them. The function accepts POST requests with the .eml file content in the request body and returns the extracted attachments as base64-encoded strings.

Features

  • Accepts .eml files through HTTP POST requests
  • Extracts all attachments from the email
  • Returns attachment information including:
    • Filename
    • Content (base64 encoded)
    • Content Type

Usage

Send a POST request to the function endpoint with the raw .eml file content in the request body.

Example Response

{
    "attachments": [
        {
            "filename": "document.pdf",
            "content": "base64_encoded_content_here",
            "content_type": "application/pdf"
        }
    ]
}

Local Development

  1. Make sure you have Azure Functions Core Tools installed
  2. Run func start to start the function locally
  3. The function will be available at http://localhost:7071/api/extract_attachments

Deployment

Deploy to Azure using VS Code Azure Functions extension or Azure Functions Core Tools:

func azure functionapp publish <FunctionAppName>

About

Azure Function App - This code explains how to extract the attachments from a (Email) .eml file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages