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); }
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); }
public object Send(NotifyBody body) { var ibody = body as SmsNotifyBody; return(null); }