Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 10th, 2006, 1:44 PM   #11
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
You're not getting me. You can specify the email address, the subject and the body as follows:
<a href="mailto:email@address.com?subject=My Subject&amp;body=The Body.">...</a>
Just change the bits in red.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 10th, 2006, 8:00 PM   #12
jtmark
Newbie
 
Join Date: Sep 2006
Posts: 7
Rep Power: 0 jtmark is on a distinguished road
Ooble,

Thanks for the reply. I think we're misunderstanding each other. Check out my comment from earlier:

"
I need a button on a webpage that will do the following steps:

1. Select all the text (ctrl-a)
2. Copy the text to the clipboard or temp space (ctrl-c)
3. Open a new Outlook email
4. Paste the text into the body of the new message
"

-JTM
jtmark is offline   Reply With Quote
Old Sep 10th, 2006, 8:21 PM   #13
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
In that case, you can use JavaScript to replace the bits in red on demand. Unfortunately, I haven't played with the DOM in a while, and so can't help you too much (without getting a lot of it wrong, at least), but hopefully someone else will be able to do so. It should be something like this:

<a href="#" onclick="javascript:var subject=escape(document.title);var body=escape(document.body.textContent);window.open('mailto:email@address.com?subject='+subject+'&body='+body);">Mail this page to someone.</a>
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 16th, 2006, 12:35 PM   #14
jtmark
Newbie
 
Join Date: Sep 2006
Posts: 7
Rep Power: 0 jtmark is on a distinguished road
Here is a working partial solution. Copy the text below into an htm file.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Click to mail content</title>
<script language='javascript'>

function doMail()
{
var text="";

if(document.all)
{
text=document.body.innerText;
}
else
{
text=document.body.textContent;
}

//alert(escape(text).length);

window.location="mailTo:?body="+escape(text);


}

</script>
</head>

<body>

<input type='button' name='btn' value="copy and mail" onclick="doMail();">


<p>&nbsp;<b>Description</b><br>
What I'm looking for is a button on a webpage that will do the following:<br>
<br>
1. Select all the text of the webpage (similar to ctrl-a)<br>
2. Copy the text to the clipboard or temp space (similar to ctrl-c)<br>
3. Open a new Outlook email<br>
4. Paste the text into the body of the new message (similar to ctrl-v)<br>
&nbsp;</p>
<p><b><font size="6">This is the version of the script. However this script has
a limitation. Due to mailTo: attribute properties of the browsers maximum size
of the email is 2kb.</font></b></p>



</body>

</html>
jtmark is offline   Reply With Quote
Old Sep 16th, 2006, 6:56 PM   #15
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Works just as well. But for the love of all things good and holy, use [code] tags.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:04 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC