I am working in a corporate environment on an internal use web application and have a requirement to generate an email in the users Outlook retaining their signature so that they can then modify if required and send it themselves.
All users are on IE8+ and the site is a part of Trusted Sites with ActiveX objects enabled so I was hoping to use outlook automation to achieve this.
Here is a quick summary of my requirements to differentiate this from existing questions.
- Only needs to support IE8+ and Outlook
- HTML body formatting support
- Attachment support
- Must retain the users configured signature
This can be achieved using JavaScript in IE if the site is a Trusted Site and ActiveX objects are enabled. I have had this script work as far back as IE6 and tested up to IE10 I am unsure about its support in IE11.
An important point about the script below is that you must call
Display
on the email before trying to extract the signature from it or trying to set itsHTMLBody
otherwise you will lose the signature information.