Click or drag to resize
IEmailExtractionExtractFromEmail Method
This method is invoked once for every attachment being saved. You can use this to extract data from the headers of the email message.

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

Example below shows how to extract the subject without spaces to a new field called {SUBJECT_NO_SPACES}.

public void ExtractFromEmail(string account, string ruleName, string uniqueID, MailMessage message)
{
    var result = new Dictionary<string, object>();
    result.Add("{SUBJECT_NO_SPACES}", message.Subject.Replace(" ", ""));
    return result;
}

Namespace: MailAttachmentDownloaderPluginAPI
Assembly: MailAttachmentDownloaderPluginAPI (in MailAttachmentDownloaderPluginAPI.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
Dictionary<string, Object> ExtractFromEmail(
	string account,
	string ruleName,
	string savedFilename,
	string attachmentFilename,
	string uniqueID,
	MailMessage message
)

Parameters

account
Type: SystemString
The email account that is being used to download this attachment.
ruleName
Type: SystemString
The matching rule name.
savedFilename
Type: SystemString
The fully qualified formatted filename including the path.
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: DictionaryString, Object
Dictionary of string to objects that can be used for replacements. Allowed object types are string, double and int.
See Also