Planning Microsoft Graph email attachment uploads
Handle attachment uploads and message-size limits before sending documents from an application.
Define the document journey
Agree which authorised user can attach a document, which mailbox is used and whether the message must be reviewed before sending. A service report should be linked to the correct customer and job before it is added to a draft.
Choose the upload method
Microsoft documents a single attachment request for files under 3 MB and an upload-session approach for files from 3 MB to 150 MB. Check the current API guidance and permissions for the chosen message workflow rather than assuming every file can use the same request.
Distinguish upload from delivery
An uploaded attachment is not proof that a message was sent or received. Exchange message limits apply to the whole message, including encoding, and the recipient’s provider may impose a smaller limit. Provide an authorised alternative when a message cannot be delivered.
Protect and test the workflow
Microsoft describes the upload URL as preauthenticated and time-limited, so keep it out of ordinary logs. Use fictional documents and mocked or isolated Graph responses to test an interrupted upload, expiry and an oversized message without sending email.