Sanchaita Chakraborty
Sanchaita Chakraborty

Reputation: 437

Deleting mails from IMAP Server

How do i delete mails from IMAP Server. I am using chilkat

Chilkat.EmailBundle bundle = imapClient.FetchHeaders(mset);

There is a method in bundle but it does not delete the mail from Server. Regards Sanchaita

Upvotes: 0

Views: 2343

Answers (1)

jdavies
jdavies

Reputation: 12894

There is good documentation (including code examples) on the Chilkat website:

Delete Email Individually (One at a time) from an IMAP Mailbox

Also:

Delete Email from an IMAP Mailbox

Other IMAP examples:

IMAP C# Examples

Hope these help.


Edit:

As per the documentation on the page below:

Chilkat C# EmailBundle Class Reference

Both the RemoveEmail and RemoveEmailByIndex methods only remove the emails from the bundle and not from the server. You will need to use another method as described in the links above to remove the message from the server.


Edit

I am not very familiar with the Chilkat library however from the documentation it seems like the "GetEmail" method in the EmailBundle class will retrieve a mail at a certain index and then you can use the "AppendMail" method in the IMap class to upload the mail to a particular inbox as specified in the following example:

Upload (Append) Email to an IMAP Mailbox

I hope this helps, if it does please mark it as answered.

Upvotes: 1

Related Questions