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.
- Accepts .eml files through HTTP POST requests
- Extracts all attachments from the email
- Returns attachment information including:
- Filename
- Content (base64 encoded)
- Content Type
Send a POST request to the function endpoint with the raw .eml file content in the request body.
{
"attachments": [
{
"filename": "document.pdf",
"content": "base64_encoded_content_here",
"content_type": "application/pdf"
}
]
}- Make sure you have Azure Functions Core Tools installed
- Run
func startto start the function locally - The function will be available at
http://localhost:7071/api/extract_attachments
Deploy to Azure using VS Code Azure Functions extension or Azure Functions Core Tools:
func azure functionapp publish <FunctionAppName>