C# OpenMailbox, CloseMailbox sample

Top  Previous  Next

C# OpenMailbox, CloseMailbox sample.

 

using MCore;

private void Form_Load(object sender, EventArgs e)

{

  int boxHandle;

  StringBuilder sb = new StringBuilder(MConstants.MSTRING_LENGTH);

  int result = LibWrap.GetOEMailbox(sb); //Get MS Outlook Express default mailbox location.

  if (result != Errors.OMS_OK)

    throw new Exception(Errors.ToString(result));

  boxHandle = LibWrap.OpenMailbox(sb.ToString()); //Open mailbox file

  if (boxHandle < Errors.OMS_NOERROR)

    throw new Exception(Errors.ToString(boxHandle)); //if error open mailbox file

  LibWrap.CloseMailbox(boxHandle); //Close mailbox file

}

 © MCore Team 2005-2008, please contact as                

Hosted by uCoz