Attaching a file to an email you send through an API is one of those tasks that looks trivial until you hit the first limit. Base64-encode a PDF into a JSON request and a 4MB file fails, because the cap is on the whole request, not the file. Inline a logo and it shows up as a separate attachment...