title: Outlook issue with sending iCalendar meeting invitation with additional (not .ics) attachment
body: <p>I need to send meeting invitations that sometimes can include .pdf attachments.
  So i'm building System.Net.Mail.MailMessage with Alternative view (for iCalendar content), with Body and with an attachment if it exists. I need that most popular mail clients (that support calendars) be able deal with my invitation emails. </p>
  
  <p>Here is my code that is pretty working for:</p>
  
  <p>gmail (web/mobile app) with/without pdf attachment<br>
  yahoo mail (web/mobile app) with/without pdf attachment<br>
  outlook (desktop) without pdf attachment only</p>
  
  <pre><code>    public virtual MailMessage CreateMailMessage(string content, Meeting meeting)
      {
          MailMessage mailMessage = new MailMessage();
          mailMessage.From = _mailsAddressesProvider.GetFromEmaiMailAddress(meeting);
          mailMessage.To.AddRange(_mailsAddressesProvider.GetToEmaiMailAddresses(meeting));
          mailMessage.CC.AddRange(_mailsAddressesProvider.GetCCEmailAddresses(meeting));
          mailMessage.Bcc.AddRange(_mailsAddressesProvider.GetBCCEmailAddresses(meeting));
  
          mailMessage.Subject = GetMessageSubject(meeting);
          mailMessage.Body = GetMessageBody(meeting);
          mailMessage.IsBodyHtml = IsBodyHtml();
  
          ContentType contentType = new ContentType("text/calendar");
          contentType.Parameters.Add("method", Method);
          contentType.Parameters.Add("name", AttachmentName);
          AlternateView avCal = AlternateView.CreateAlternateViewFromString(content, contentType);
          mailMessage.AlternateViews.Add(avCal);
  
          AddAttachments(mailMessage, meeting);
  
          return mailMessage;
      }
  
      public virtual bool AddAttachments(MailMessage mailMessage, Meeting meeting)
      {
          byte[] meetingMaterialsBytes = _meetingMaterialsRepository.GetMeetingMaterails(meeting);
          if (meetingMaterialsBytes == null || meetingMaterialsBytes.Length == 0)
          {
              return false;
          }
          ContentType contentType = new ContentType(MediaTypeNames.Application.Pdf);
          Attachment attach = new Attachment(new MemoryStream(meetingMaterialsBytes), contentType);
          attach.ContentDisposition.FileName = "MeetingMaterials.pdf";
          attach.ContentDisposition.Inline = true;
          attach.ContentDisposition.DispositionType = DispositionTypeNames.Inline;
          attach.ContentId = "MeetingMaterials";
  
          mailMessage.Attachments.Add(attach);
          return true;
      }
  </code></pre>
  
  <p>So the issue is when email with attachment is being opened in Outlook.</p>
  
  <p>Here is how such an email is opened in Outlook <strong>without</strong> pdf attachment - OK:</p>
  
  <p>Here is how such an email is opened in Outlook <strong>with</strong> pdf attachment - OK:
  Probably there is no issue with iCalendar (ics) content but with System.Net.Mail.MailMessage object. </p>
  
  <p>So the problem is that I need Outlook to open an email with attachment as a meeting invitation but not as a ordinary email.</p>
  
  <p>Any suggestions about what can be wrong with my MailMessage parts?
  Thanks in advance.</p>