Based on your code, I see you want to open the outlook window from the javascript.
For this issue, I suggest you use the mailto to complete it like below.
<script language="javascript">
function TriggerOutlook() {
var body = escape(window.document.title + String.fromCharCode(13) + window.location.href);
var subject = "Take a look at this cool code snippet from CodeDigest.Com!!";
window.location.href = "mailto:?body=" + body + "&subject=" + subject;
}
</script>
<input id="Button1" type="button" value="button" onclick="TriggerOutlook()" />
You can also use the ActiveXObject("Outlook.Application") for it like below.
Member
438 Points
606 Posts
Diplaying Email window on the foreground
Apr 02, 2014 04:58 AM|mnmhemaj|LINK
I am using the following code to open outlook from VB.NET
This works fine. But I need to popup the email window on the top of the screen. (I can see the outlook icon blinking on the taskbar.)
All-Star
30411 Points
3628 Posts
Re: Diplaying Email window on the foreground
Apr 03, 2014 03:36 AM|Fuxiang Zhang - MSFT|LINK
Hi mnmhemaj,
Thank you post the issue to asp.net forum.
Based on your code, I see you want to open the outlook window from the javascript.
For this issue, I suggest you use the mailto to complete it like below.
You can also use the ActiveXObject("Outlook.Application") for it like below.
http://blogs.msdn.com/b/rajnishkaushik/archive/2007/05/06/compose-and-send-e-mail-from-javascript-by-using-outlook-automation-2007.aspx
Hope that helps, thanks.
Best Regards!
Member
438 Points
606 Posts
Re: Diplaying Email window on the foreground
Apr 03, 2014 09:07 AM|mnmhemaj|LINK
Hi Fuxiang
Thanks for your solution. I require one more help.
I want to embed a link to filesystem in the body.
I tried like
var body = "<a href=file:////\\\\srv2\\inetpub\\wwwroot\\TM\\Attachments\\" & " >Link to files</a>";
But it is not helping. Can you correct it?
Thanks.
All-Star
30411 Points
3628 Posts
Re: Diplaying Email window on the foreground
Apr 03, 2014 09:55 PM|Fuxiang Zhang - MSFT|LINK
Hi mnmhemaj,
Glad to see your back.
For adding a link to email body, you can refer to below threads fro some help.
http://stackoverflow.com/questions/4710349/how-to-pass-url-in-mailtos-body
http://stackoverflow.com/questions/247245/is-it-possible-to-add-an-html-link-in-the-body-of-a-mailto-link
Thanks.
Best Regards!