AppendMessage - IMAP007 BAD Could not parse command

Jun 27, 2008 at 5:58 AM
         Debug log message  display - IMAP007 BAD Could not parse command.  The message cannot append to Drafts folder. 
         Any some idea save the email  message to server.        Would you mind helping me .
            On the other hand, i want to send out email via InterIMAP  Library . Do you have an example code.
. Thank


          //IMAPConfig config = new IMAPConfig("<host>", "<username>", "<password>", false, true, "");
         // i using gmail IMAP account
            IMAPConfig config = new IMAPConfig(@"c:\temp\test1.cfg");
            config.CacheFile = "";
            IMAPClient client = null;
                client = new IMAPClient(config, null, 5);
            catch (IMAPException e)

            IMAPFolder drafts = client.Folders["Drafts"];

            IMAPMessage newMessage = new IMAPMessage();
            newMessage.From.Add(new IMAPMailAddress("Jason Miesionczek", ""));
            newMessage.To.Add(new IMAPMailAddress("Jason Miesionczek", ""));
            newMessage.Date = DateTime.Now;
            newMessage.Subject = "this is a new message";
            drafts.AppendMessage(newMessage, "this is the content of the new message");

Jun 27, 2008 at 1:40 PM
As the comments in the changeset on the source code page mention, the AppendMessage method is present, but not currently working. I have not been able to determine what is causing the erorr that is being returned from the IMAP server. Once i do discover the solution i will be sure to update the code.

Sending email is not a function of an IMAP server. you need SMTP for that. .NET has built-in classes for accomplishing this which im sure a quick google search will provide the answer you seek.