Skip to content

Explain how to use replyall() method in c# for outlook item?

Ram Naik

Asked May 23, 2014, 8:49 PM EDT1 answer
Share
LinkedInX
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. 

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Umesh Kumar
    +1
    Hi Good Day,

    Java
    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); }
    +1