Joe W Larson
2004-10-29 19:46:52 UTC
I've been up and down trying to figure this one out with no luck. Is it
possible to have a mailto link or some other way with Javascript that can
send the HTML content of the current page or of an IFRAME in the page as an
email?
Here's what I have:
----------------
<HTML>
<SCRIPT LANGUAGE="JavaScript">
<!--//
function mailIt() {
var cnthtm=escape(document.content.document.all[0].innerHTML);
var
url="mailto:***@coldmail.com?subject=hey&body="+document.content
.document.all[0].innerHTML;
var EmailWindow = window.open(url, EmailWindow,
"status=yes,height=400,width=600,scrollbars=yes,location=yes,statusbar=yes,r
esizable=yes,toolbar=yes");
EmailWindow.focus();
}
//-->
</SCRIPT>
<BODY STYLE="margin: 0px; padding: 0px;">
<A HREF="javascript:mailIt();">Email to ***@coldmail.com</A>
<IFRAME NAME="content" SRC="test.htm" WIDTH=100% HEIGHT=90% STYLE="margin:
0px; padding: 0px;"></IFRAME>
</BODY>
</HTML>
----------------
The Test.htm looks like this:
---------------
<HTML>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
x
</BODY>
</HTML>
---------------
Though the final version will include lots of HTML.
Anyway, what happens is an email opens with the HTML source showing. Is
there away to have it actually treated as HTML and rendered such as if it
where na HTML mail (yes, I know everyone out there does not support HTML
email, but we'll be in a controlled environment).
Or, alternatively, is there a way to specify an attachement for a mailto
url?
The real content being mailed will only be accessable on the intranet while
logged in, so just emailing the URL is not an option.
Any help would be appreciated!
possible to have a mailto link or some other way with Javascript that can
send the HTML content of the current page or of an IFRAME in the page as an
email?
Here's what I have:
----------------
<HTML>
<SCRIPT LANGUAGE="JavaScript">
<!--//
function mailIt() {
var cnthtm=escape(document.content.document.all[0].innerHTML);
var
url="mailto:***@coldmail.com?subject=hey&body="+document.content
.document.all[0].innerHTML;
var EmailWindow = window.open(url, EmailWindow,
"status=yes,height=400,width=600,scrollbars=yes,location=yes,statusbar=yes,r
esizable=yes,toolbar=yes");
EmailWindow.focus();
}
//-->
</SCRIPT>
<BODY STYLE="margin: 0px; padding: 0px;">
<A HREF="javascript:mailIt();">Email to ***@coldmail.com</A>
<IFRAME NAME="content" SRC="test.htm" WIDTH=100% HEIGHT=90% STYLE="margin:
0px; padding: 0px;"></IFRAME>
</BODY>
</HTML>
----------------
The Test.htm looks like this:
---------------
<HTML>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
x
</BODY>
</HTML>
---------------
Though the final version will include lots of HTML.
Anyway, what happens is an email opens with the HTML source showing. Is
there away to have it actually treated as HTML and rendered such as if it
where na HTML mail (yes, I know everyone out there does not support HTML
email, but we'll be in a controlled environment).
Or, alternatively, is there a way to specify an attachement for a mailto
url?
The real content being mailed will only be accessable on the intranet while
logged in, so just emailing the URL is not an option.
Any help would be appreciated!
--
I'm Joe Larson, and I approve this message
http://www.soundclick.com/joewlarson
We're Bushed-- please Kerry us! - Kerry Edwards 2004
I'm Joe Larson, and I approve this message
http://www.soundclick.com/joewlarson
We're Bushed-- please Kerry us! - Kerry Edwards 2004