Show / Hide Table of Contents

Interface IMAPI

Defines functionality to open the default client email-dialog.

Namespace: Sartorius.SAF.MAPI
Assembly: Sartorius.SAF.dll
Syntax
public interface IMAPI
Examples

The following example shows how to import the default implementation of IMAPI and open the default mail client.

    [Import]
    private ExportFactory<IMAPI> MapiExport { get; set; }

    private void OpenMailClient()
    {
        using (var export = MapiExport.CreateExport())
        {
            var mapi = export.Value;
            mapi.AddRecipient("info@sartorius.com");
            mapi.AddCcRecipient("info@sartorius-stedim.com");
            mapi.AddBccRecipient("info@sartorius-stedim.com");

            var file = new FileInfo("test.pdf");
            mapi.AddAttachment(file.FullName);

            mapi.OpenMail("TestSubject", "TestMail with attachment");
        }
    }

Methods

View Source

AddAttachment(String)

Adds an attachment from the specified file location.

Declaration
void AddAttachment(string attachmentFileName)
Parameters
Type Name Description
System.String attachmentFileName

The path to the attachment file.

View Source

AddBccRecipient(String)

Adds the specified recipient to the BCC field

Declaration
void AddBccRecipient(string bcc)
Parameters
Type Name Description
System.String bcc

The email address of the recipient.

View Source

AddCcRecipient(String)

Adds the specified recipient to the CC field

Declaration
void AddCcRecipient(string cc)
Parameters
Type Name Description
System.String cc

The email address of the recipient.

View Source

AddRecipient(String)

Adds the specified recipient to the To field.

Declaration
void AddRecipient(string recipient)
Parameters
Type Name Description
System.String recipient

The email address of the recipient.

View Source

OpenMail(String, String)

Opens the default mail application with the given data.

Declaration
void OpenMail(string subject, string body)
Parameters
Type Name Description
System.String subject

A subject value.

System.String body

A body content.

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX