Show / Hide Table of Contents

Class EMailHelper

Helper class for mail tasks

Inheritance
Object
EMailHelper
Namespace: SuperOffice.CRM.Mail
Assembly: SoDataBase.dll
Syntax
public static class EMailHelper : Object

Methods

GetEnvelopeSet(SortedDictionary<String, MailEnvelope>, Int32, Int32, Boolean)

Given a sorted list of MailEnvelopes, retrieve a specific set

Declaration
public static List<MailEnvelope> GetEnvelopeSet(SortedDictionary<string, MailEnvelope> sortedEnvelopes, int from, int to, bool reverse)
Parameters
Type Name Description
SortedDictionary<String, MailEnvelope> sortedEnvelopes

Source list to retrieve items from

Int32 from

Retrieve items from this index

Int32 to

Retrieve items to this index

Boolean reverse

If true, retrieve items starting from the end of the list

Returns
Type Description
List<MailEnvelope>

List of MailEnvelopes as specified by input parameters

GetFileExtensionValidator()

Get a validator for file extensions

Declaration
public static FileExtensionValidator GetFileExtensionValidator()
Returns
Type Description
FileExtensionValidator

GetMissingIds(List<MailEnvelope>, MailEnvelope[])

Find all items that exist in first set, and not in second set

Declaration
public static List<int> GetMissingIds(List<MailEnvelope> first, MailEnvelope[] second)
Parameters
Type Name Description
List<MailEnvelope> first

First set of MailEnvelope items

MailEnvelope[] second

Second set of MailEnvelope items

Returns
Type Description
List<Int32>

List of MailEnvelope.ServerId

GetPlainHTMLBody(String)

Retrieve plain text version of a html source

Declaration
public static string GetPlainHTMLBody(string source)
Parameters
Type Name Description
String source

HTML to convert to plain text

Returns
Type Description
String

Plain text version of the provided html

GetSortString(MailSortCriterion, MailEnvelope)

Based on a sort order, find and format the proper value of MailEnvelope

Declaration
public static string GetSortString(MailSortCriterion sortOrder, MailEnvelope env)
Parameters
Type Name Description
MailSortCriterion sortOrder

What field to use for sorting

MailEnvelope env

The envelope instance to get data from

Returns
Type Description
String

Formatted string that may be used for sorting a set of MailEnvelopes

PopulateEnvelopesArchivedInfo(MailEnvelope[])

Loop through envelopes and find connections to archived activities/documents

Declaration
public static void PopulateEnvelopesArchivedInfo(MailEnvelope[] envelopes)
Parameters
Type Name Description
MailEnvelope[] envelopes

Envelopes to populate

PopulateEnvelopesCompanyPersonInfo(MailEnvelope[])

Loop through envelopes and find companies and persons from SuperOffice that match the e-mails in sender properties (From address) of the envelope

Declaration
public static void PopulateEnvelopesCompanyPersonInfo(MailEnvelope[] envelopes)
Parameters
Type Name Description
MailEnvelope[] envelopes

Envelopes to populate

ResolveAddress(Int32[])

Search database for one or more e-mail addresses by id, and return list with matched data

Declaration
public static MailAddress[] ResolveAddress(int[] emailIds)
Parameters
Type Name Description
Int32[] emailIds
Returns
Type Description
MailAddress[]

List of MailAddress instances with matched data

ResolveAddress(String, Boolean)

Search database for a single e-mail address, and return list with matched data

Declaration
public static MailAddress[] ResolveAddress(string address, bool onlyEmail = false)
Parameters
Type Name Description
String address

Address to look for

Boolean onlyEmail

Bool we only want to search for EmailType.Email

Returns
Type Description
MailAddress[]

List of MailAddress instances with matched data

ResolveAddresses(MailItem)

Search database for all addresses in the provided set of MailAddress instances Limit each query to kMaxQueryInCount in parameters

Declaration
public static void ResolveAddresses(MailItem mailItem)
Parameters
Type Name Description
MailItem mailItem

MailItem whose addresses we want to resolve.

ResolveAddresses(List<MailAddress>)

Search database for all addresses in the provided set of MailAddress instances Limit each query to kMaxQueryInCount in parameters

Declaration
public static void ResolveAddresses(List<MailAddress> addressObjects)
Parameters
Type Name Description
List<MailAddress> addressObjects

List of MailAddress instances. MailAddress.Address property need to be populated in advance.

© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top