Archived Forum Post

Index of archived forum posts

Question:

How to Mark an Email as Not Junk/Spam Using IMAP on C# ?

Jan 30 '17 at 16:49

Hello everybody i use this code and i don't know if it do the same functionality of "Non Junk" button in the other ISPs Web application like Outlook, Yahoo or Gmail:

var email = imap.FetchSingle(messageSet.GetId(i), bUid);
imap.SetMailFlagAsync(email, "NonJunk", 1);
...
//then move all message to the INBOX Folder
imap.MoveMessages(messageSet, "INBOX");

Please help, thanks for advance


Accepted Answer

The NonJunk flag is not a standard (system) flag name. Different IMAP servers may have different flag names (other than the pre-defined system flag names of \Answered \Flagged \Deleted \Seen \Draft)

This example demonstrates how to get a list of valid flag names from the SELECT mailbox response.

Android: IMAP Get List of Flags

Classic ASP: IMAP Get List of Flags

C: IMAP Get List of Flags

C++: IMAP Get List of Flags

C#: IMAP Get List of Flags

C# UWP/WinRT: IMAP Get List of Flags

DataFlex: IMAP Get List of Flags

Delphi ActiveX: IMAP Get List of Flags

Delphi DLL: IMAP Get List of Flags

.NET Core C#: IMAP Get List of Flags

Excel: IMAP Get List of Flags

Visual FoxPro: IMAP Get List of Flags

Java: IMAP Get List of Flags

Lianja: IMAP Get List of Flags

MFC: IMAP Get List of Flags

Mono C#: IMAP Get List of Flags

Node.js: IMAP Get List of Flags

Objective-C: IMAP Get List of Flags

Perl: IMAP Get List of Flags

PHP ActiveX: IMAP Get List of Flags

PHP Extension: IMAP Get List of Flags

PowerBuilder: IMAP Get List of Flags

PowerShell: IMAP Get List of Flags

PureBasic: IMAP Get List of Flags

Python: IMAP Get List of Flags

Ruby: IMAP Get List of Flags

SQL Server: IMAP Get List of Flags

Swift: IMAP Get List of Flags

Tcl: IMAP Get List of Flags

Unicode C: IMAP Get List of Flags

Unicode C++: IMAP Get List of Flags

Visual Basic 6.0: IMAP Get List of Flags

VB.NET: IMAP Get List of Flags

VB.NET UWP/WinRT: IMAP Get List of Flags

VBScript: IMAP Get List of Flags

Xojo Plugin: IMAP Get List of Flags


Answer

See this:

Android: Examine Junk/NonJunk Flags on Outlook.com and GMail

Classic ASP: Examine Junk/NonJunk Flags on Outlook.com and GMail

C: Examine Junk/NonJunk Flags on Outlook.com and GMail

C++: Examine Junk/NonJunk Flags on Outlook.com and GMail

C#: Examine Junk/NonJunk Flags on Outlook.com and GMail

C# UWP/WinRT: Examine Junk/NonJunk Flags on Outlook.com and GMail

DataFlex: Examine Junk/NonJunk Flags on Outlook.com and GMail

Delphi ActiveX: Examine Junk/NonJunk Flags on Outlook.com and GMail

Delphi DLL: Examine Junk/NonJunk Flags on Outlook.com and GMail

.NET Core C#: Examine Junk/NonJunk Flags on Outlook.com and GMail

Excel: Examine Junk/NonJunk Flags on Outlook.com and GMail

Visual FoxPro: Examine Junk/NonJunk Flags on Outlook.com and GMail

Java: Examine Junk/NonJunk Flags on Outlook.com and GMail

Lianja: Examine Junk/NonJunk Flags on Outlook.com and GMail

MFC: Examine Junk/NonJunk Flags on Outlook.com and GMail

Mono C#: Examine Junk/NonJunk Flags on Outlook.com and GMail

Node.js: Examine Junk/NonJunk Flags on Outlook.com and GMail

Objective-C: Examine Junk/NonJunk Flags on Outlook.com and GMail

Perl: Examine Junk/NonJunk Flags on Outlook.com and GMail

PHP ActiveX: Examine Junk/NonJunk Flags on Outlook.com and GMail

PHP Extension: Examine Junk/NonJunk Flags on Outlook.com and GMail

PowerBuilder: Examine Junk/NonJunk Flags on Outlook.com and GMail

PowerShell: Examine Junk/NonJunk Flags on Outlook.com and GMail

PureBasic: Examine Junk/NonJunk Flags on Outlook.com and GMail

Python: Examine Junk/NonJunk Flags on Outlook.com and GMail

Ruby: Examine Junk/NonJunk Flags on Outlook.com and GMail

SQL Server: Examine Junk/NonJunk Flags on Outlook.com and GMail

Swift: Examine Junk/NonJunk Flags on Outlook.com and GMail

Tcl: Examine Junk/NonJunk Flags on Outlook.com and GMail

Unicode C: Examine Junk/NonJunk Flags on Outlook.com and GMail

Unicode C++: Examine Junk/NonJunk Flags on Outlook.com and GMail

Visual Basic 6.0: Examine Junk/NonJunk Flags on Outlook.com and GMail

VB.NET: Examine Junk/NonJunk Flags on Outlook.com and GMail

VB.NET UWP/WinRT: Examine Junk/NonJunk Flags on Outlook.com and GMail

VBScript: Examine Junk/NonJunk Flags on Outlook.com and GMail

Xojo Plugin: Examine Junk/NonJunk Flags on Outlook.com and GMail