Question

i'm building a simple webMail and use imap protocol. i want to add draft option to my webmail & need an imap command for save a message(which not completed composition) in draft folder? could anybody help me?

Was it helpful?

Solution

Use the APPEND command. It doesn't matter if the message is incomplete. As long as it's a properly formatted email with a header and a body, you can add it to a folder.

APPEND is in fact the only command that exists in IMAP that allows you to add new content to the remote server, so you would use the same command to save the completed message to a "Sent" folder.

OTHER TIPS

Example:
C: A003 APPEND saved-messages (\Seen) {310}

S: + Ready for literal data

C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)

C: From: Fred Foobar

C: Subject: afternoon meeting

C: To: mooch@owatagu.siam.edu

C: Message-Id:

C: MIME-Version: 1.0

C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII

C:

C: Hello Joe, do you think we can meet at 3:30 tomorrow?

C:

S: A003 OK APPEND completed

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top