Example #1
0
        private void SetupRoutes()
        {
            hMailServer.Routes routes = _application.Settings.Routes;

            hMailServer.Route route = routes.Add();
            route.DomainName  = "test1.com";
            route.Description = "description";
            route.UseSSL      = true;
            route.TreatSenderAsLocalDomain    = true;
            route.TreatRecipientAsLocalDomain = false;
            route.Save();

            route             = routes.Add();
            route.DomainName  = "test2.com";
            route.Description = "description2";
            route.UseSSL      = false;
            route.TreatSenderAsLocalDomain    = false;
            route.TreatRecipientAsLocalDomain = true;
            route.Save();

            hMailServer.RouteAddresses addresses = route.Addresses;

            hMailServer.RouteAddress address1 = addresses.Add();
            address1.Address = "*****@*****.**";
            address1.Save();

            hMailServer.RouteAddress address2 = addresses.Add();
            address2.Address = "*****@*****.**";
            address2.Save();
        }
Example #2
0
        private void buttonAddRecipient_Click(object sender, EventArgs e)
        {
            formInputDialog inputDialog = new formInputDialog();

            inputDialog.Title = "Address";
            inputDialog.Text  = "Enter email address";

            if (inputDialog.ShowDialog() == DialogResult.OK)
            {
                hMailServer.RouteAddresses routeAddresses = _representedObject.Addresses;
                hMailServer.RouteAddress   routeAddress   = routeAddresses.Add();

                routeAddress.Address = inputDialog.Value;
                routeAddress.Save();

                Marshal.ReleaseComObject(routeAddress);
                Marshal.ReleaseComObject(routeAddresses);
            }

            ListRecipients();
        }