raj3060
asked on
Send Page by E-Mail command
Hi Experts,
Do we have any equivalent command for Send Page by E-Mail like there is for Save, SaveAs, Copy, and so on like this:
document.execCommand('Save As');
I tried this but did not work:
document.execCommand('Send PagebyE-Ma il');
Any suggestions..
Do we have any equivalent command for Send Page by E-Mail like there is for Save, SaveAs, Copy, and so on like this:
document.execCommand('Save
I tried this but did not work:
document.execCommand('Send
Any suggestions..
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Its using the mailto: command.Not a recommended method.Check the below ex
<html>
<head>
<title>TEST</title>
<script type="text/javascript">
<!--
function mailIt(fObj){
fObj.encoding = 'text/plain';
fObj.action = "mailto:abc@ced.com?subjec t=URL"
}
window.onload = function(){
document.forms[0].Please_S ee_This_Li nk.value = window.location;
}
// -->
</script>
</head>
<body>
<form name="form1" method="post" action="" onsubmit="mailIt(this);">
<input type="text" name="Please_See_This_Link ">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
<html>
<head>
<title>TEST</title>
<script type="text/javascript">
<!--
function mailIt(fObj){
fObj.encoding = 'text/plain';
fObj.action = "mailto:abc@ced.com?subjec
}
window.onload = function(){
document.forms[0].Please_S
}
// -->
</script>
</head>
<body>
<form name="form1" method="post" action="" onsubmit="mailIt(this);">
<input type="text" name="Please_See_This_Link
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
ASKER
That is not what I am looking, try to open some word document or any web page and then from file menu select Send and then click on Page by E-Mail, and see what it does, it will open you email client with that page attached.
I am looking for the document.execCommand('Send pagebyE-Ma il') equivalent.
-Raj
I am looking for the document.execCommand('Send
-Raj
Sorry but that functionality is not available
ASKER
grrrrrrrrrrrrrrr.. Let's wait and see if any one else knows anything abt it..
you can use ASP like so:
<%
Set myMail=CreateObject("CDO.M essage")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydoma in.com"
myMail.To="someone@somedom ain.com"
myMail.CreateMHTMLBody "https://www.experts-exchange.com"
myMail.Send
%>
you can only send HTML files not ASP or PHP or ect.
<%
Set myMail=CreateObject("CDO.M
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydoma
myMail.To="someone@somedom
myMail.CreateMHTMLBody "https://www.experts-exchange.com"
myMail.Send
%>
you can only send HTML files not ASP or PHP or ect.
OR this one
<HTML>
<HEAD>
<script language="Javascript">
function setHTML(){
document.frm1.htmlbody.val ue=documen t.body.par entNode.ou terHTML;
}
</script>
</HEAD>
<BODY onload="setHTML()">
<form name="frm1" action="email.asp" method="post">
Email:<input type="text" name="Email">
<input type="submit" name="submit" value="Submit">
<input type="hidden" name="htmlbody">
</form>
<%
if Request.Form("email")<>"" Then
Set myMail=Server.CreateObject ("CDO.Mess age")
myMail.Subject="Message Subject"
myMail.From="mymail@mydoma in.com"
myMail.To=Request.Form("em ail")
myMail.HTMLBody = Request.Form("htmlbody")
myMail.Send
End If
%>
</BODY>
</HTML>
<HTML>
<HEAD>
<script language="Javascript">
function setHTML(){
document.frm1.htmlbody.val
}
</script>
</HEAD>
<BODY onload="setHTML()">
<form name="frm1" action="email.asp" method="post">
Email:<input type="text" name="Email">
<input type="submit" name="submit" value="Submit">
<input type="hidden" name="htmlbody">
</form>
<%
if Request.Form("email")<>"" Then
Set myMail=Server.CreateObject
myMail.Subject="Message Subject"
myMail.From="mymail@mydoma
myMail.To=Request.Form("em
myMail.HTMLBody = Request.Form("htmlbody")
myMail.Send
End If
%>
</BODY>
</HTML>
save both pages as "email.asp"
<HTML>
<HEAD>
<script language="Javascript">
function setHTML(){
document.getElementById("a
}
</script>
</HEAD>
<BODY>
<form name="frm1">
Email:<input name="email" onchange="setHTML()"><a href="#">Send Email</a>
</form>
</BODY>
</HTML>
sorry not that one...
<HTML>
<HEAD>
<script language="Javascript">
function setHTML(){
document.getElementById("a n").href=" mailto:"+d ocument.fr m1.email.v alue+"?bod y="+docume nt.body.pa rentNode.o uterHTML;
}
</script>
</HEAD>
<BODY>
<form name="frm1">
Email:<input type="text" name="email"><a id="an" href="#" onmouseover="setHTML()">Se nd Email</a>
</form>
</BODY>
</HTML>
either one is the most stupid way of doing this :)
<HTML>
<HEAD>
<script language="Javascript">
function setHTML(){
document.getElementById("a
}
</script>
</HEAD>
<BODY>
<form name="frm1">
Email:<input type="text" name="email"><a id="an" href="#" onmouseover="setHTML()">Se
</form>
</BODY>
</HTML>
either one is the most stupid way of doing this :)
ASKER
Using JSP/JAVA..
My requirement is that I have a JSP page that has data coming From DB. Now allow user to either print this page or email the page as attachement.
Any suggestion?
My requirement is that I have a JSP page that has data coming From DB. Now allow user to either print this page or email the page as attachement.
Any suggestion?
ASKER
Increasing the points to 500
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That is the email program, does not tell anything how to attach a page to email.
Hi,
I know it's not what you asked for..but could you either:
a) frame the page in the email body (resident on server, dynamic content from db)
or
b) include a link to the page online?
The user could do everything they could if the file was an attachment...
I know it's not what you asked for..but could you either:
a) frame the page in the email body (resident on server, dynamic content from db)
or
b) include a link to the page online?
The user could do everything they could if the file was an attachment...
ASKER
dreamer007, that's a good idea. Please give me example how to do it.
Thanks
Thanks
Ok,
Quick and dirty way:
<a href="mailto:11811@eircom. net?Body=P lease view your file:%0A%0Ahttp://www.thisisyourname.com/demo/file.txt%0A%0APrint it:%0A%0Ahttp://www.thisisyourname.com/demo/file.html">Send Link to a File</a></p>
The first link in the email is a standard txt file, so it opens - the user can print if they want.
The second one is a html file, with <body onload="window.print()"> in it, so it requests a print operation as soon as it's finished.
You could use an SSI to include another document, if it's not possible to have the onload inserted automatically.
The not-so-quick-and-much-clea ner is a custom (PHP for example) scrpt that sends HTML to frame the file.
d.
Quick and dirty way:
<a href="mailto:11811@eircom.
The first link in the email is a standard txt file, so it opens - the user can print if they want.
The second one is a html file, with <body onload="window.print()"> in it, so it requests a print operation as soon as it's finished.
You could use an SSI to include another document, if it's not possible to have the onload inserted automatically.
The not-so-quick-and-much-clea
d.
ASKER
Points refund. Didn't get what I was looking for.
Thanks
Thanks
> Didn't get what I was looking for.
you ain't getting it yet, because it's impossible and you have to accept the truth, what so many experts put so much effort in it and you are going to delete this question just like that? you were presented with various ways of doing what you asked for and use them...
you ain't getting it yet, because it's impossible and you have to accept the truth, what so many experts put so much effort in it and you are going to delete this question just like that? you were presented with various ways of doing what you asked for and use them...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will give points tomorrow.
Thanks all.
Thanks all.
ASKER
>>you were presented with various ways of doing what you asked for and use them...
What if it don't work for me? None of these solutions work for me. Before I asked this question I tried everything (as far as I know).
Anyway points are granted. Thanks for all your efforts and sharing the knowledge.
What if it don't work for me? None of these solutions work for me. Before I asked this question I tried everything (as far as I know).
Anyway points are granted. Thanks for all your efforts and sharing the knowledge.
you wanted "document.execCommand('Sen dpagebyE-M ail')" which doesn't exists, we showed you what exists and what you can use to achieve this, and you have to put up with this wether you like it or not... :)
ASKER
-Raj