Example #1
0
        public Email(ExportSettings settings)
        {
            _settings = settings;

            _smtpClient = new SmtpClient(_settings.SmtpServer);

            _mail.From = new MailAddress(_settings.EmailFromAddress);

            AddSender();

            _smtpClient.Port = _settings.PortNumber;
            _smtpClient.Credentials = new System.Net.NetworkCredential(_settings.UserName, _settings.Password);
            //SmtpServer.EnableSsl = true;
        }
Example #2
0
        public Setup(ExportSettings settings, IEnumerable<IExporter> exporters)
        {
            _settings = settings;

            InitializeComponent();

            UpdateUI();

            foreach (IExporter exporter in exporters)
            {
                if (exporter is IPageOutputConverter)
                    _pageConverters.Add(exporter as IPageOutputConverter);
                if (exporter is IDocumentOutputConverter)
                    _docConverters.Add(exporter as IDocumentOutputConverter);
            }

            cbSinglePage.Checked = _settings.ReleaseMode == ReleaseMode.SinglePage;
            cbMultipage.Checked = _settings.ReleaseMode == ReleaseMode.MultiPage;
        }
Example #3
0
 public void DeserializeSettings(Stream input)
 {
     using (BinaryReader reader = new BinaryReader(input))
     {
         try
         {
             _settings.EmailToAddress = reader.ReadString();
             _settings.EmailCcAddress = reader.ReadString();
             _settings.EmailBccAddress = reader.ReadString();
             _settings.EmailFromAddress = reader.ReadString();
             _settings.SmtpServer = reader.ReadString();
             _settings.UserName = reader.ReadString();
             _settings.Password = reader.ReadString();
             _settings.FileTypeId = new Guid(reader.ReadString());
             _settings.ReleaseMode = (ReleaseMode)Enum.Parse(typeof(ReleaseMode), reader.ReadString());
             _settings.PortNumber = reader.ReadInt32();
         }
         catch
         {
             _settings = new ExportSettings();
         }
     }
 }