Ejemplo n.º 1
0
        public void Send(string address, string subject, string content)
        {
            if (!Mail.LimitCheck(address, subject))
            {
                throw ResponseException.LogicalError("操作过于频繁");
            }

            EventPublisher.Publish(new SendMailEvent()
            {
                Address = address,
                Subject = subject,
                Content = content
            });
        }
Ejemplo n.º 2
0
        public void Send(string address, string subject, string content, ITransactionContext?transactionContext)
        {
            if (subject.IsNullOrEmpty())
            {
                throw ResponseException.ArgError("邮件标题不能为空");
            }

            if (!Mail.LimitCheck(address, subject))
            {
                throw ResponseException.LogicalError("操作过于频繁");
            }

            EventPublisher.PublishAsync(new SendMailEvent()
            {
                Address = address, Subject = subject, Content = content
            }, transactionContext).Wait();
        }