Hi @SriRaghavendran Prabhakaran ,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
To validate the total file size of multiple attachments before sending an email using the SMTP connector in Azure Logic Apps, follow these steps:
- Use the appropriate email connector to obtain the email attachments. If the files are sourced from an HTTP request or another system, look for a property like "Content-Length" that indicates the size of each attachment.
- Create a variable to maintain a running total of the attachment sizes, initializing it to 0.
- Implement a For Each loop to iterate through each attachment. Within this loop, retrieve the size of each attachment and add it to the running total variable.
- After the loop, add a step to check the total size against your predefined limit. If the total size exceeds this limit, take appropriate action, such as sending an error message or preventing the email from being sent.
- If the total size is within the acceptable limit, proceed to send the email with the attachments.
If you encounter issues while summing the file sizes, ensure that you are accurately retrieving the size for each attachment and that your variable is being updated correctly within the loop.
For your reference, please review the following documentation for further clarification."
- Tutorial: Create workflows that process emails using Azure Logic Apps, Azure Functions, and Azure Storage
- Create variables to store and manage values in Azure Logic Apps
I hope this helps! Let me know if you have any further questions or need additional assistance.