C# - How to include Outlook signature in an email that contains images?

前端 未结 2 1740
说谎
说谎 2021-01-24 19:11

Here is my code to send the email in Outlook 2013:

public void GenerateEmail(OutEmail outEmail)
{
    var objOutlook = new         


        
相关标签:
2条回答
  • 2021-01-24 19:28

    try below mentioned

    mailItem.GetInspector.Activate();
    var signature = mailItem.HTMLBody;
    mailItem.HTMLBody = EmailBody + signature;
    
    0 讨论(0)
  • 2021-01-24 19:35

    Outlook inserts the signature when you call MailItem.Display or access MailItem.GetInspector (you do not have to do anything with the returned object).

    If you want to programmatically insert a signature, Redemption exposes RDOSignature object which implements ApplyTo method.

    UPDATE: as of the latest (Summer 2017) builds of Outlook, GetInspector trick no longer works. Now only MailItem.Display adds the signature to an unmodified message.

    0 讨论(0)
提交回复
热议问题