GemBox.Email
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    MailMessageCollection Class

    Namespace:
    GemBox.Email
    Assembly:
    GemBox.Email.dll

    Represents a collection of MailMessage elements.

    • C#
    • VB.NET
    public class MailMessageCollection : Collection<MailMessage>, IList<MailMessage>, ICollection<MailMessage>, IList, ICollection, IReadOnlyList<MailMessage>, IReadOnlyCollection<MailMessage>, IEnumerable<MailMessage>, IEnumerable
    Public Class MailMessageCollection
        Inherits Collection(Of MailMessage)
        Implements IList(Of MailMessage), ICollection(Of MailMessage), IList, ICollection, IReadOnlyList(Of MailMessage), IReadOnlyCollection(Of MailMessage), IEnumerable(Of MailMessage), IEnumerable
    Inheritance:
    System.Object
    System.Collections.ObjectModel.Collection<MailMessage>
    MailMessageCollection
    Implements
    System.Collections.Generic.IList<MailMessage>
    System.Collections.Generic.ICollection<MailMessage>
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IReadOnlyList<MailMessage>
    System.Collections.Generic.IReadOnlyCollection<MailMessage>
    System.Collections.Generic.IEnumerable<MailMessage>
    System.Collections.IEnumerable

    Constructors

    MailMessageCollection()

    Initializes a new instance of the MailMessageCollection class.

    • C#
    • VB.NET
    public MailMessageCollection()
    Public Sub New

    MailMessageCollection(IList<MailMessage>)

    Initializes a new instance of the MailMessageCollection class from a list of mail messages.

    • C#
    • VB.NET
    public MailMessageCollection(IList<MailMessage> list)
    Public Sub New(list As IList(Of MailMessage))
    Parameters
    list
    System.Collections.Generic.IList<MailMessage>

    List of mail messages

    Methods

    LazyLoad(Stream, MailMessageFormat)

    Lazily yields all messages from the specified file.

    • C#
    • VB.NET
    public static IEnumerable<MailMessage> LazyLoad(Stream stream, MailMessageFormat format)
    Public Shared Function LazyLoad(stream As Stream, format As MailMessageFormat) As IEnumerable(Of MailMessage)
    Parameters
    stream
    System.IO.Stream

    The stream from which the messages will be loaded.

    format
    MailMessageFormat

    The message collection format.

    Returns
    System.Collections.Generic.IEnumerable<MailMessage>

    IEnumerable of MailMessage

    Exceptions
    System.ArgumentException

    File path is null or empty.

    System.ArgumentException

    Unknown message collection format.

    LazyLoad(String)

    Lazily yields all messages from the specified file.

    • C#
    • VB.NET
    public static IEnumerable<MailMessage> LazyLoad(string filePath)
    Public Shared Function LazyLoad(filePath As String) As IEnumerable(Of MailMessage)
    Parameters
    filePath
    System.String

    A relative or absolute path to the file.

    Returns
    System.Collections.Generic.IEnumerable<MailMessage>

    IEnumerable of MailMessage

    Exceptions
    System.ArgumentException

    File path is null or empty.

    LazyLoad(String, MailMessageFormat)

    Lazily yields all messages from the specified file.

    • C#
    • VB.NET
    public static IEnumerable<MailMessage> LazyLoad(string filePath, MailMessageFormat format)
    Public Shared Function LazyLoad(filePath As String, format As MailMessageFormat) As IEnumerable(Of MailMessage)
    Parameters
    filePath
    System.String

    A relative or absolute path to the file.

    format
    MailMessageFormat

    The message collection format.

    Returns
    System.Collections.Generic.IEnumerable<MailMessage>

    IEnumerable of MailMessage

    Exceptions
    System.ArgumentException

    File path is null or empty.

    System.ArgumentException

    Unknown message collection format.

    Load(Stream, MailMessageFormat)

    Loads the collection of all messages from the specified stream.

    • C#
    • VB.NET
    public static MailMessageCollection Load(Stream stream, MailMessageFormat format)
    Public Shared Function Load(stream As Stream, format As MailMessageFormat) As MailMessageCollection
    Parameters
    stream
    System.IO.Stream

    The stream from which the message collection will be loaded.

    format
    MailMessageFormat

    The message collection format.

    Returns
    MailMessageCollection

    MailMessageCollection instance.

    Exceptions
    System.ArgumentNullException

    Stream is null.

    System.ArgumentException

    Unknown message collection format.

    Load(Stream, MailMessageFormat, Int32)

    Loads the message at the specific position from the specified stream.

    • C#
    • VB.NET
    public static MailMessage Load(Stream stream, MailMessageFormat format, int index)
    Public Shared Function Load(stream As Stream, format As MailMessageFormat, index As Integer) As MailMessage
    Parameters
    stream
    System.IO.Stream

    The stream from which the message will be loaded.

    format
    MailMessageFormat

    The message collection format.

    index
    System.Int32

    Position of the message to be loaded, indexed from zero

    Returns
    MailMessage

    MailMessage instance.

    Exceptions
    System.ArgumentNullException

    Stream is null.

    System.ArgumentException

    Unknown message format.

    System.IndexOutOfRangeException

    Message with a given index was not found.

    Load(String)

    Loads the collection of all messages from the specified file.

    • C#
    • VB.NET
    public static MailMessageCollection Load(string filePath)
    Public Shared Function Load(filePath As String) As MailMessageCollection
    Parameters
    filePath
    System.String

    A relative or absolute path to the file.

    Returns
    MailMessageCollection

    MailMessageCollection instance.

    Exceptions
    System.ArgumentException

    File path is null or empty.

    Load(String, MailMessageFormat)

    Loads the collection of all messages from the specified file.

    • C#
    • VB.NET
    public static MailMessageCollection Load(string filePath, MailMessageFormat format)
    Public Shared Function Load(filePath As String, format As MailMessageFormat) As MailMessageCollection
    Parameters
    filePath
    System.String

    A relative or absolute path to the file.

    format
    MailMessageFormat

    The message collection format.

    Returns
    MailMessageCollection

    MailMessageCollection instance.

    Exceptions
    System.ArgumentException

    File path is null or empty.

    Load(String, MailMessageFormat, Int32)

    Loads the message at the specific position from the specified file.

    • C#
    • VB.NET
    public static MailMessage Load(string filePath, MailMessageFormat format, int index)
    Public Shared Function Load(filePath As String, format As MailMessageFormat, index As Integer) As MailMessage
    Parameters
    filePath
    System.String

    A relative or absolute path to the file.

    format
    MailMessageFormat

    The message collection format.

    index
    System.Int32

    Position of the message to be loaded, indexed from zero

    Returns
    MailMessage

    MailMessage instance.

    Exceptions
    System.ArgumentException

    File path is null or empty.

    System.IndexOutOfRangeException

    Message with a given index was not found.

    Load(String, Int32)

    Loads the message at the specific position from the specified file.

    • C#
    • VB.NET
    public static MailMessage Load(string filePath, int index)
    Public Shared Function Load(filePath As String, index As Integer) As MailMessage
    Parameters
    filePath
    System.String

    A relative or absolute path to the file.

    index
    System.Int32

    Position of the message to be loaded, indexed from zero

    Returns
    MailMessage

    MailMessage instance.

    Exceptions
    System.ArgumentException

    File path is null or empty.

    System.IndexOutOfRangeException

    Message with a given index was not found.

    LoadHeaders(Stream, MailMessageFormat)

    Loads HeaderCollection for each message from the specified stream.

    • C#
    • VB.NET
    public static List<HeaderCollection> LoadHeaders(Stream stream, MailMessageFormat format)
    Public Shared Function LoadHeaders(stream As Stream, format As MailMessageFormat) As List(Of HeaderCollection)
    Parameters
    stream
    System.IO.Stream

    The stream from which the System.Collections.Generic.List<T> will be loaded.

    format
    MailMessageFormat

    The message collection format.

    Returns
    System.Collections.Generic.List<HeaderCollection>

    List of HeaderCollection.

    Exceptions
    System.ArgumentNullException

    Stream is null.

    System.ArgumentException

    Unknown message collection format.

    LoadHeaders(String)

    Loads HeaderCollection for each message from the specified file.

    • C#
    • VB.NET
    public static List<HeaderCollection> LoadHeaders(string filePath)
    Public Shared Function LoadHeaders(filePath As String) As List(Of HeaderCollection)
    Parameters
    filePath
    System.String

    A relative or absolute path to the file.

    Returns
    System.Collections.Generic.List<HeaderCollection>

    List of HeaderCollection.

    Exceptions
    System.ArgumentException

    File path is null or empty.

    LoadHeaders(String, MailMessageFormat)

    Loads HeaderCollection for each message from the specified file.

    • C#
    • VB.NET
    public static List<HeaderCollection> LoadHeaders(string filePath, MailMessageFormat format)
    Public Shared Function LoadHeaders(filePath As String, format As MailMessageFormat) As List(Of HeaderCollection)
    Parameters
    filePath
    System.String

    A relative or absolute path to the file.

    format
    MailMessageFormat

    The message collection format.

    Returns
    System.Collections.Generic.List<HeaderCollection>

    List of HeaderCollection.

    Exceptions
    System.ArgumentException

    File path is null or empty.

    Save(Stream, MailMessageFormat)

    Saves the message collection to a stream.

    • C#
    • VB.NET
    public void Save(Stream stream, MailMessageFormat format)
    Public Sub Save(stream As Stream, format As MailMessageFormat)
    Parameters
    stream
    System.IO.Stream

    The stream to save the message collection to.

    format
    MailMessageFormat

    The message collection format.

    Exceptions
    System.ArgumentNullException

    Stream is null.

    System.ArgumentException

    Unsupported message collection format.

    Save(String)

    Saves the message collection to a file.

    • C#
    • VB.NET
    public void Save(string filePath)
    Public Sub Save(filePath As String)
    Parameters
    filePath
    System.String

    A relative or absolute path for the file where message will be saved.

    Exceptions
    System.ArgumentException

    File path is null or empty.

    Save(String, MailMessageFormat)

    Saves the message collection to a file.

    • C#
    • VB.NET
    public void Save(string filePath, MailMessageFormat format)
    Public Sub Save(filePath As String, format As MailMessageFormat)
    Parameters
    filePath
    System.String

    A relative or absolute path for the file where message collection will be saved.

    format
    MailMessageFormat

    The message collection format.

    Exceptions
    System.ArgumentException

    File path is null or empty.

    Implements

    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IReadOnlyList<T>
    System.Collections.Generic.IReadOnlyCollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.