Explain how to use replyall() method in c# ?
I want to include all cc members in responding mail and same subject.
I searched in MSDN but no example is provided.
Can you please help me out?
Thank you,
Ram.
Know the answer? Post it. Somebody with the same question will find it here.
Umesh Kumar122 pointsPosted May 25, 2014, 12:14 AM EDT
private static void CreateAnswer(MailItem item, int pbiId, SupportType st) { MailItem answer = item.ReplyAll(); answer.Subject = String.Concat(String.Format("[{0}] ", pbiId), answer.Subject); Recipient rec = answer.Recipients.Add("Test"); rec.Type = (int)OlMailRecipientType.olCC; rec.Resolve(); answer.BodyFormat = OlBodyFormat.olFormatHTML; string ressourceFile = String.Format("OutlookExtender2.{0}.html", st.ToString()); Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(ressourceFile); StreamReader sr = new StreamReader(stream); string text = sr.ReadToEnd(); string[] senderParts = item.SenderName.Split(' '); string rawOrigBody = GetRawHtmlBody(item.HTMLBody); string htmlBody = ReplaceBodyText(text, senderParts.Last(), pbiId); htmlBody = htmlBody.Insert(htmlBody.IndexOf("</body>"), rawOrigBody); answer.HTMLBody = htmlBody; answer.Importance = MapImportanceToSupportType(st); answer.Display(false); }