0

Is there a way to add tables to an appointment body object?

To build mail body content I´m using TinyMCE. Appointments are sent with Exchange Web Services (EWS).

The problem is HTML body will not display tables build in TinyMCE or even as plain HTML <table>...</table>.

How can this problem be solved and send formatted tables as an appointment in EWS?

Environment: VS 2013, C#, Exchange Web Services (EWS) in Exchange 2010

  • What ServicePack/rollup is your server at, there is known issue with Appointments and HTML https://support.microsoft.com/en-gb/kb/2689810 so this maybe affecting you ? – Glen Scales Apr 14 '15 at 05:23
  • I don´t know about the rollup. Do you maybe habe some valid code to test it? Thanks. – user3752660 Apr 14 '15 at 14:38
  • @user3752660 https://technet.microsoft.com/en-us/library/hh135098%28v=exchg.150%29.aspx – Jan Doggen Apr 30 '15 at 08:47

1 Answers1

0

This works for me okay

             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);
Glen Scales
  • 20,495
  • 1
  • 20
  • 23
  • You can see this table in an outlook client? – user3752660 Apr 15 '15 at 16:07
  • Yes sent through 2013 can see it in Outlook 2013, GMail and Yahoo – Glen Scales Apr 15 '15 at 22:38
  • Sorry for my delay. What about border? Does this work? I dont see borders style: border 1px solid black doesn´t work. – user3752660 Apr 24 '15 at 10:50
  • Please take a look at the example. – user3752660 Apr 24 '15 at 11:17
  • The problem is when you try to do more complex things in HTML with CSS you going to hit issues I would suggest you look at https://www.campaignmonitor.com/css/ also the template tools they offer are quite good at constructing an email that will work in all clients. – Glen Scales Apr 27 '15 at 06:24
  • I think that a template will not solve the problem. It´s an simple table that has been resend in an appointment. Could you reproduce it? Are there some other solutions please? – user3752660 Apr 27 '15 at 18:19
  • I would suggest you go a simple google on html email and borders and you will see this is know problem with Outlook. Have you tried using the template or the other suggested methods to fix the issue ?. If i try it I get no boarder as per the what other people report in Outlook but it works fine in other Email clients. Worse still if I create a table in OWA it doesn't display in Outlook which is clearly a bug ... – Glen Scales Apr 28 '15 at 05:19
  • @user3752660 As Glen said, there is only so much you can do with HTML and CSS in one 'blob'. This is the same issue that people are having when sending [email newsletters](https://www.google.com/search?q=css+email+news+letters). It's a matter of trial and error which features display well. Glen's link is a good starting point. – Jan Doggen Apr 30 '15 at 08:52