예제 #1
0
        public void AddEMail(eMail mail)
        {
            MongoDatabase mongoDatabase = this._mongoServer.GetDatabase("email_user_" + this._id);
            MongoCollection <eMailEntity> mongoCollection = mongoDatabase.GetCollection <eMailEntity>("mails");

            eMailAddress headerFrom = new eMailAddress(this.Username, this.eMail);

            mail.SetReplyTo(this.Username, this.eMail);

            eMailEntity mailEntity = new eMailEntity {
                Time          = mail.Time,
                MailFrom      = mail.MailFrom,
                HeaderReplyTo = mail.HeaderReplyTo,
                Subject       = mail.Subject,
                RecipientTo   = mail.RecipientTo,
                ClientName    = "eMailServer.NET",
                Message       = mail.Message,
                HeaderFrom    = headerFrom,
                RawHeader     = mail.RawHeader
            };
            WriteConcernResult result = mongoCollection.Insert(mailEntity, WriteConcern.Acknowledged);

            logger.Info("WriteConcernResult: " + result.Ok);
        }
예제 #2
0
		public void AddEMail(eMail mail) {
			MongoDatabase mongoDatabase = this._mongoServer.GetDatabase("email_user_" + this._id);
			MongoCollection<eMailEntity> mongoCollection = mongoDatabase.GetCollection<eMailEntity>("mails");

			eMailAddress headerFrom = new eMailAddress(this.Username, this.eMail);
			mail.SetReplyTo(this.Username, this.eMail);

			eMailEntity mailEntity = new eMailEntity {
				Time = mail.Time,
				MailFrom = mail.MailFrom,
				HeaderReplyTo = mail.HeaderReplyTo,
				Subject = mail.Subject,
				RecipientTo = mail.RecipientTo,
				ClientName = "eMailServer.NET",
				Message = mail.Message,
				HeaderFrom = headerFrom,
				RawHeader = mail.RawHeader
			};
			WriteConcernResult result = mongoCollection.Insert(mailEntity, WriteConcern.Acknowledged);

			logger.Info("WriteConcernResult: " + result.Ok);
		}