What is the correct way to upload an attachment before sending an email via the Zimbra SOAP API?
Upload the attachment using `FileUploadServlet` at `https://<server>/service/upload?fmt=raw,extended`. Include the file in a POST request with a `Cookie` header containing the auth token. The response returns an `aid` (server attachment ID) and file type. This attachment ID is then used in the `SendMsg` command. For full details, refer to the [Zimbra SOAP API Development Guide 3 - Email Operations](/news/zimbra-soap-api-development-guide-3-email-operations) and the related [Zimbra SOAP API Development Guide 5 - Email Forwarding](/news/zimbra-soap-api-development-guide-5-email-forwarding) for advanced email operations.
Related article:
Zimbra SOAP API Development Guide 3 - Email Operations