C# OpenMailbox, CloseMailbox sample.

 

using AIRMail SDK;

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 
}

   © AIRMail SDK Team 2005-2008, please contact as