How do I send an email using the Java Mail API that contains large attachments (~25 MB)? The attachments are files stored online with our cloud storage provider (Google Cloud Storage). The API for the service returns an `InputStream` object or a `ReadableByteChannel` object for each file.

I can't use `ByteArrayDataSource` to create a `MimeBodyPart` because it creates a copy of the entire file that resides in the memory, and we get a `OutOfMemoryError`. 

If its a physical file, we can create a `FileDataSource` object and attach to the email. But can we do it with an `InputStream` object?

I can't increase the heap size because increasing it to 25MB seems like a very bad idea. If you have any other ideas too, please let me know. We're working on the Google App Engine platform.