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 SourceAddAttachment(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.  | 
      
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.  | 
      
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.  | 
      
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.  | 
      
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.  |