It is working (new email window opened in Outlook and prefilled with above data), but only when line that supposed to add attachment is commented out. Once the browser loads the page, click on the button Send Email. [Solved] Open Default mail client with filled html in body - CodeProject How do I open a .xls email attachment in Open Office. Follow the link to the Office 365 Message Encryption Portal (OME Portal) where you need to authenticate. At last, in order to send an attachment just write the following code in sendMail() function: Attachments : [{ name : "File_Name_with_Extension", path:"Full Path of the file" }] So the final JavaScript code after the above configuration will look like as follows: Filename: index.html Note Here is the javascript I used: var email="mpdionne@bruyere.org"; var subject="Meditech training completed"; var body_start="Hello, this is to confirm tthat I have complete the Meditech part 2 training . Hanika, The answer is simple, adding an attachment programmatically is almost only. I believe external e-mail apps do provide the level of inter-app communication necessary. Downloads: 924 This Week. you could then make the activex clickable and the click event would start the process. A few days ago a client asked me if I could send out emails with attachments using client side code only. 4. NOTE: The path to the 'email_body_file' and attachments is relative to the 'content' folder of the a sset as shown in the following graphic. using System.Runtime.InteropServices; [DllImport(" MAPI32.DLL")] private static extern int MAPISendMail(IntPtr sess, IntPtr hwnd, MapiMessage message, int flg, int rsv);. open link in new tab html. Programmatically adding attachments to emails in C# and VB.NET how do I use mailto with attachment???