Add the default outlook signature in the email generated

前端 未结 11 468
甜味超标
甜味超标 2020-12-08 07:11

I am using the Microsoft.Office.Interop.Outlook.Application to generate an email and display it on the screen before the user can send it. The application is a

11条回答
  •  爱一瞬间的悲伤
    2020-12-08 08:06

    For anyone looking for an answer after all those years.

    In Outlook 2016 mailItem.HTMLBody already contains your default signature/footer.

    In my case I replied to someone. If you want to add a message before just do as shown below. Simple.

    MailItem itemObj = item as MailItem; //itemObj is the email I am replying to
    var itemReply = itemObj.Reply();
    itemReply.HTMLBody = "Your message" + itemReply.HTMLBody; //here happens the magic, your footer is already there in HTMLBody by default, just don't you delete it :)
    itemReply.Send();
    

提交回复
热议问题