Example #1
0
        public object Send(NotifyBody body)
        {
            var        ibody = body as EmailNotifyBody;
            SmtpClient smtp  = new SmtpClient
            {
                DeliveryMethod = SmtpDeliveryMethod.Network,
                Host           = ibody.Host,
                Port           = ibody.Port,
                Credentials    = new NetworkCredential(ibody.UserName, ibody.Password)
            };

            if (ibody.Port != 25)
            {
                smtp.EnableSsl = true;
            }

            MailMessage mm = new MailMessage
            {
                Priority     = MailPriority.Normal,
                From         = new MailAddress(ibody.From, ibody.Subject, ibody.BodyEncoding),
                Subject      = ibody.Subject,
                Body         = ibody.Content,
                BodyEncoding = ibody.BodyEncoding,
                IsBodyHtml   = ibody.IsBodyHtml
            };

            mm.To.Add(ibody.To);

            smtp.Send(mm);
            return(true);
        }
Example #2
0
        public object Send(NotifyBody body)
        {
            var    ibody  = body as InternalNotifyBody;
            Entity entity = new Entity("notice");

            entity.SetAttributeValue("name", ibody.Subject);
            entity.SetAttributeValue("content", ibody.Content);
            entity.SetAttributeValue("linkto", ibody.LinkTo);
            entity.SetAttributeValue("isread", false);
            entity.SetAttributeValue("typecode", new OptionSetValue(ibody.TypeCode));
            entity.SetAttributeValue("ownerid", new OwnerObject(OwnerTypes.SystemUser, ibody.ToUserId));
            _dataCreater.Create(entity, true);
            return(true);
        }
Example #3
0
        public object Send(NotifyBody body)
        {
            var ibody = body as SmsNotifyBody;

            return(null);
        }