IEmailFilteringShouldProcessAttachment Method |
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");
}
Namespace: MailAttachmentDownloaderPluginAPIAssembly: MailAttachmentDownloaderPluginAPI (in MailAttachmentDownloaderPluginAPI.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax bool ShouldProcessAttachment(
string account,
string ruleName,
string attachmentFilename,
string uniqueID,
MailMessage message
)
Function ShouldProcessAttachment (
account As String,
ruleName As String,
attachmentFilename As String,
uniqueID As String,
message As MailMessage
) As Boolean
bool ShouldProcessAttachment(
String^ account,
String^ ruleName,
String^ attachmentFilename,
String^ uniqueID,
MailMessage^ message
)
abstract ShouldProcessAttachment :
account : string *
ruleName : string *
attachmentFilename : string *
uniqueID : string *
message : MailMessage -> bool
Parameters
- account
- Type: SystemString
The email account that is being used to download this attachment. - ruleName
- Type: SystemString
The matching rule name. - attachmentFilename
- Type: SystemString
The attachment filename without the path. - uniqueID
- Type: SystemString
The uniqueID for the email. - message
- Type: System.Net.MailMailMessage
The email message.
Return Value
Type:
Booleantrue if download attachment, false if not
See Also