emailsmtpgmailimap

How to send email drafts via IMAP without downloading attachments?


I'm developing a lightweight email client for mobile devices using IMAP. I've encountered a challenge when trying to send emails from the Drafts folder efficiently:

Current Situation:

What I've Tried:

  1. Moving/copying the draft to the "Sent" mail folder (this only relocates the message without sending)
  2. Standard SMTP sending approach (requires downloading all attachments first)

Specific Questions:

  1. Is there an IMAP command allowing sending an existing draft without downloading its contents?
  2. If not, what's the most efficient way to handle this scenario while minimizing data transfer?

Solution

  • IMAP is a mailbox protocol. It does not (natively) support sending mail, only accessing it. In order to send mail you must use SMTP. Its possible that there is an IMAP extension for sending mail, and its possible that Google Mail supports that extension, but I doubt it. Hence, if you want to send an email with attachments, you must actually have the full content of the message available to you to send.