title: Sending the Html in body with meeting Invitation C#
body: <p>I have a requirement to send the meeting request with html body Tag.I have successfully send the meeting request it work perfectly.</p>
  
  <p>Here is the ICS file format</p>
  
  <pre><code>BEGIN:VCALENDAR
  VERSION:2.0
  PRODID:-//A//B//EN
  CALSCALE:GREGORIAN
  METHOD:REQUEST
  BEGIN:VEVENT
  ORGANIZER;CN="Organizer":mailto:#FROM#
  ATTENDEE;CN="Attendee";CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=
   NEEDS-ACTION;RSVP=TRUE:mailto:#TO#
  DTSTART:#DTSTART#
  DTEND:#DTEND#
  LOCATION:#LOCATION#
  SUMMARY: Invitation for Meeting
  TRANSP:OPAQUE
  SEQUENCE:0
  UID:#UID#
  DTSTAMP:#CREATED-AT#
  CREATED:#CREATED-AT#
  LAST-MODIFIED:#CREATED-AT#
  DESCRIPTION: #DESCRIPTION#
  X-ALT-DESC;FMTTYPE=text/html: #X-ALT-DESC#
  PRIORITY:5
  CLASS:PUBLIC
  END:VEVENT
  END:VCALENDAR
  </code></pre>
  
  <p>I found some link to send the html link wiht X-ALT-DESC option but it not work for me </p>
  
  <p><a href="https://stackoverflow.com/questions/27383906/send-an-outlook-meeting-request-with-c-sharp">Send an Outlook Meeting Request with C#</a></p>
  
  <p><a href="https://stackoverflow.com/questions/27383906/send-an-outlook-meeting-request-with-c-sharp">Send an Outlook Meeting Request with C#</a></p>
  
  <p><a href="https://stackoverflow.com/questions/22734403/send-email-to-outlook-with-ics-meeting-appointment">Send email to Outlook with ics meeting appointment</a></p>
  
  <p><a href="https://stackoverflow.com/questions/22734403/send-email-to-outlook-with-ics-meeting-appointment">Send email to Outlook with ics meeting appointment</a></p>
  
  <p>Here is the C# code to send the email with ICS file </p>
  
  <pre><code>filePath = Path.Combine(HttpRuntime.AppDomainAppPath, "Email/calenderInvitation.ics");
                  fileContent = System.IO.File.OpenText(filePath).ReadToEnd();
                  fileContent = fileContent.Replace("#TO#", receiver);
                  fileContent = fileContent.Replace("#FROM#", fromAddress.Address);
                  fileContent = fileContent.Replace("#LOCATION#", eventVenue);
                  fileContent = fileContent.Replace("#UID#", Guid.NewGuid().ToString().Replace("-", ""));
                  fileContent = fileContent.Replace("#CREATED-AT#", Convert.ToDateTime(meetingDate).ToString(TimeFormat));
                  fileContent = fileContent.Replace("#DTSTART#", Convert.ToDateTime(startTime).ToString(TimeFormat));
                  fileContent = fileContent.Replace("#DTEND#", Convert.ToDateTime(finishTime).ToString(TimeFormat));
                  filePath = Path.Combine(HttpRuntime.AppDomainAppPath, "Email/InvitationEmail.html");
                  fileInviationContent = System.IO.File.OpenText(filePath).ReadToEnd();
                  String body = AppendRedirectURl(fileInviationContent, callBackUrl);
                  fileContent = fileContent.Replace("#X-ALT-DESC#", body);
                  MailMessage message = new MailMessage();
                 // message.IsBodyHtml = true;
                  message.From = new MailAddress(fromAddress.Address);
                  message.To.Add(new MailAddress(receiver));
                  message.Subject = string.Format("{0}  {1} @ {2} {3} {4} {5} - {6}", "Invitation: ", meetingTypeName,
                      Convert.ToDateTime(meetingDate).ToString("dddd"), Convert.ToDateTime(startTime).ToString("MMMM"),
                      Convert.ToDateTime(startTime).ToString("yyyy"), startTime,
                      finishTime);
  
                  var iCalendarContentType = new ContentType("text/calendar; method=REQUEST");
                  var calendarView = AlternateView.CreateAlternateViewFromString(fileContent, iCalendarContentType);
                  calendarView.TransferEncoding = TransferEncoding.SevenBit;
                  message.AlternateViews.Add(calendarView);
                  await smtp.SendMailAsync(message);
  </code></pre>
  
  <p>Here is the Debugger response </p>
  
  <pre><code>BEGIN:VCALENDAR
  VERSION:2.0
  PRODID:-//A//B//EN
  CALSCALE:GREGORIAN
  METHOD:REQUEST
  BEGIN:VEVENT
  ORGANIZER;CN="Organizer":mailto:admin@wordflow.info
  ATTENDEE;CN="Attendee";CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=
   NEEDS-ACTION;RSVP=TRUE:mailto:anandjaisy@gmail.com
  DTSTART:20171206T081500Z
  DTEND:20171206T090000Z
  LOCATION:asdasd
  SUMMARY: Invitation for Meeting
  TRANSP:OPAQUE
  SEQUENCE:0
  UID:b17f15326c5343ff98d76bf6092ed2b4
  DTSTAMP:20171212T000000Z
  CREATED:20171212T000000Z
  LAST-MODIFIED:20171212T000000Z
  DESCRIPTION: #DESCRIPTION#
  X-ALT-DESC;FMTTYPE=text/html: &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;br&gt;&lt;br&gt;&lt;br&gt;
      &lt;form class="container"&gt;
          &lt;div class="form-group"&gt;
              &lt;label&gt;Click on  Accept or Decline to add event to your Email Calender &lt;/label&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
              &lt;label&gt;Will you Attend the Meeting&lt;/label&gt;
              &lt;a href="https://localhost:44380/Meetings/GotMeetingConfirm?userId=08c5bb4f-f4f8-4183-a99a-e82544970dd4&amp;meetingId=6c9747e2-aeb9-4d27-8db6-077ee1d9cee9&amp;resposne=True" id="YesConfirmMeeting" class="btn btn-primary"&gt;Yes&lt;/a&gt;
              &lt;a href="https://localhost:44380/Meetings/GotMeetingConfirm?userId=08c5bb4f-f4f8-4183-a99a-e82544970dd4&amp;meetingId=6c9747e2-aeb9-4d27-8db6-077ee1d9cee9&amp;resposne=False" id="NoConfirmMeeting" class="btn btn-danger"&gt;No&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="form-group text-center"&gt;
  
          &lt;/div&gt;
      &lt;/form&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  PRIORITY:5
  CLASS:PUBLIC
  END:VEVENT
  END:VCALENDAR
  </code></pre>
  
  <p>It send the invitation but body is not been send </p>