private void buttonAddWhiteList_Click(object sender, EventArgs e)
{
formGreyListingWhiteAddress whiteDlg = new formGreyListingWhiteAddress();
if (whiteDlg.ShowDialog() == DialogResult.OK)
{
hMailServer.Application app = APICreator.Application;
hMailServer.Settings settings = app.Settings;
hMailServer.AntiSpam antiSpamSettings = settings.AntiSpam;
hMailServer.GreyListingWhiteAddresses greyListingWhiteAddresses = antiSpamSettings.GreyListingWhiteAddresses;
hMailServer.GreyListingWhiteAddress whiteAddress = greyListingWhiteAddresses.Add();
whiteDlg.SaveProperties(whiteAddress);
whiteAddress.Save();
Marshal.ReleaseComObject(settings);
Marshal.ReleaseComObject(antiSpamSettings);
Marshal.ReleaseComObject(greyListingWhiteAddresses);
Marshal.ReleaseComObject(whiteAddress);
ListWhiteListAddresses();
}
}