Click or drag to resize
IEmailFiltering Methods

The IEmailFiltering type exposes the following members.

Methods
  NameDescription
Public methodShouldProcessAttachment
Implement this function and return true if the attachment should be downloaded and false if not. Note that returning true would still require other filters defined as part of the rule to match. Returning false will always prevent the file from being downloaded.

This function may be invoked from multiple threads simultaneously for different emails for parallel processing.

Example below shows how you can only have PDF files downloaded programmatically.

public bool ShouldProcessAttachment(string account, string ruleName, string attachmentFilename, string uniqueID, MailMessage message)
{
    return attachmentFilename.ToLowerInvariant().Contains(".pdf");
}
Top
See Also