When using IMAP you can use CommonFolders
class to identify known folders, you just need to obtain email folders from the server first. CommonFolders.Trash
represents a trash/bin folder:
CommonFolders folders = new CommonFolders(imap.GetFolders());
FolderInfo trash = folders.Trash;
Then use Imap.MoveMessageByUID
to move the message to the trash folder:
long uid = ...;
imap.MoveMessageByUID(uid, trash);
Unfortunately there is no concept of folders in POP3 (note this is not a limitation of Mail.dll, but the POP3 protocol itself.
Good POP3 server would move messages that were deleted using POP3 to trash folder by itself.