1

I have created a MailMessage which is really a meeting request but problem is when it shows up in my Outlook I can accept/decline like with any other meeting request. This is great. However, now I am trying to add attachments to the MailMessage when I do this, it successfully adds the attachment however when the email is received in Outlook it is no longer a meeting request I can accept/decline, instead it's just an email with the meeting information inside of it and the attachment attached. How do I programmatically attach the attachment while at the same time keeping the meeting request functionality?

user2323308
  • 759
  • 5
  • 16
  • 34
  • Can you post what you have tried? – Ramesh Durai Apr 26 '13 at 10:10
  • MailMessage msg = new MailMessage(); if (file != null & fileName != string.Empty) { Attachment obj = new Attachment(fileName); msg.Attachments.Add(obj); } – user2323308 Apr 26 '13 at 10:23
  • ystem.Net.Mime.ContentType calendarType = new System.Net.Mime.ContentType("text/calendar"); calendarType.Parameters.Add("method", "REQUEST"); calendarType.Parameters.Add("name", "meeting.ics"); string bodyCalendar = "BEGIN:VCALENDAR\r\nMETHOD:REQUEST\r\nPRODID:Microsoft CDO for Microsoft Exchange\r\nVERSION:2.0\r\nBEGIN:VTIMEZONE\r\nTZID:(..."; AlternateView calendarView = AlternateView.CreateAlternateViewFromString(bodyCalendar, calendarType); calendarView.TransferEncoding = TransferEncoding.SevenBit; msg.AlternateViews.Add(calendarView); – user2323308 Apr 26 '13 at 10:33
  • @user2323308 can you edit your question...? – deostroll Mar 16 '15 at 04:52

0 Answers0