I am developing a lightweight Gmail client for mobile phones, accessing Gmail by IMAP. I want to send a draft from the Drafts folder, but it has some attachments and I cannot download all of them to send it by SMTP.
Moving/copying it to "Sent Mail" does not send it, just moves it to that folder.
How can I send a Draft directly without fetching all the content and attachments from the client? Is there any IMAP command to do it?
IMAP allows you to access your email wherever you are, from any device. When you read an email message using IMAP, you aren't actually downloading or storing it on your computer; instead, you're reading it from the email service.
In short, IMAP is the protocol that email clients like Mail. app, Thunderbird, and Mailspring use to download messages from your email account and to make changes like archiving messages or sorting them into folders.
What Is IMAP? The Internet Message Access Protocol, also known as IMAP, is a protocol for receiving emails from a server. Since IAMP allows access to emails from multiple locations simultaneously, it keeps the email on the server after being delivered.
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.
IMAP was designed to receive email messages, not to send it. There is no IMAP command for sending email AFAIK. There is, however, at least one IMAP server which supports a special 'Outbox' folder. When you place the message into this folder it will be sent automatically.
Check Courier-IMAP documentation on Sending mail via an IMAP connection. Note, that this is a non standard method and I'm not aware of any other server which supports this.
There RFC 4468 which extends SMTP so it can fetch the mail content from the IMAP server, but I don't know about any working and widely used implementation.
Talking about gmail: sticking with SMTP is probably the safest way to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With