如何将表添加到约会主体(EWS)?

时间:2015-04-13 08:04:39

标签: c# .net tinymce exchangewebservices appointment

有没有办法将表添加到约会主体对象?

使用TinyMCE构建邮件正文内容。约会与Exchange Web服务(EWS)一起发送。

问题是HTML正文不会显示在TinyMCE中构建的表格,甚至不会显示为纯HTML <table>...</table>

如何解决此问题并将格式化表格作为预约在EWS中发送?

  

环境:Exchange 2010中的VS 2013,C#,Exchange Web服务(EWS)

2 个答案:

答案 0 :(得分:0)

这对我有用

             String Body = "<table style=\"width:100%\">"
          +"<tr>"
          +"  <td>Jill</td>"
          +"  <td>Smith</td> "
         +"   <td>50</td>"
         +" </tr>"
         +" <tr>"
         +"   <td>Eve</td>"
         +"   <td>Jackson</td> "
         +"   <td>94</td>"
         +" </tr>"
         + "</table>";


            Appointment TestApt = new Appointment(service);
            TestApt.Body = new MessageBody(BodyType.HTML, Body);
            TestApt.Subject = "test";
            TestApt.Start = DateTime.Now;
            TestApt.RequiredAttendees.Add("user@domain.com");
            TestApt.End = DateTime.Now.AddHours(1);
            TestApt.Save(SendInvitationsMode.SendToAllAndSaveCopy);

答案 1 :(得分:0)

使用表创建约会有效,但更新它们不起作用。

var message = "<table style=\"width:100%; border:1px solid black;\"><tr><td>Jill</td><td>Smith</td> <td>50</td></tr><tr><td>Eve</td><td>Jackson</td><td>94</td></tr></table>";

ItemId itemId = new ItemId(appointment.UniqueId);
                Appointment appointment = Appointment.Bind(service, itemId);
                appointment.Subject = "test";
                appointment.Body = new MessageBody(BodyType.HTML, message);
                appointment.Start = DateTime.Now;
                appointment.End = DateTime.Now.AddHours(1);
                appointment.RequiredAttendees.Add("user@domain.com");
                appointment.Update(ConflictResolutionMode.AlwaysOverwrite);

以下约会未正确生成。

你可以复制吗?