Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   Copy text of webpage and paste into new email? (http://www.programmingforums.org/showthread.php?t=11275)

jtmark Sep 8th, 2006 12:44 PM

Copy text of webpage and paste into new email?
 
Hi all,

How would I go about creating a button to copy the text of a webpage and insert it into a new Outlook email? I would like to put this button on several of my web pages so I can easily forward the text of these webpages to people who request it.

If anyone knows of a webpage with this button, it would be particularly helpful.

Thanks!

JTM

hoffmandirt Sep 8th, 2006 12:55 PM

Is this a basic html webpage or jsp?

jtmark Sep 8th, 2006 2:30 PM

Thanks for the reply. It's a jsp page.

hoffmandirt Sep 8th, 2006 2:50 PM

Well what I think what you want to do is lookinto the java mail api. http://java.sun.com/products/javamail/. As long as you can get your outgoing mail server, you can easily create and send messages to any recipients. Here is the faq. http://java.sun.com/products/javamail/FAQ.html

jtmark Sep 9th, 2006 11:42 AM

I don't think that's quite what I'm looking for. 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

Is this possible?

Thanks!

-JTM

Arevos Sep 9th, 2006 12:22 PM

This functionality could potentially be created as a Internet Explorer plugin or as a Firefox extension, but it would have to be an alteration to the browser on the client machine. Due to security issues, this sort of functionality is not available through server-side code. Websites can only interact with users in a deliberately limited fashion.

What one can do, however, is to send a mail from the server that contains the contents of the website. Another option is to get a macro-recording program and bind a series of commands (such as Ctrl-C, open outlook, new mail, Ctrl-V) to a hotkey of some description. I don't know of any program that can do this on Windows, but presumably there should be a way.

Ooble Sep 9th, 2006 8:52 PM

You can do it in a hyperlink, though it's not pretty and I'm not sure it's totally standards-compliant.
:

<a href="mailto:me@example.org?subject=Meep.&amp;body=Meep is a funny word.">Mail someone else.</a>

jtmark Sep 10th, 2006 8:45 AM

a href="mailto:me@example.org?subject=Meep.&amp;body=Meep is a funny word.">Mail someone else.

I don't think that would quite do it. I'm looking for a button to copy the text of a webpage and then paste it into the body of a blank Outlook email.

Ooble Sep 10th, 2006 8:48 AM

Then insert the text into the "body"?

jtmark Sep 10th, 2006 10:51 AM

Yes, the body of a new Outlook email. I want the text of the webpage to be inserted into the body of a new Outlook email. A new email consists of three sections: the "To:" field, the "Subject:" field, and the "body" of the email where the content goes. I'm not trying to be smart here, just going for clarity. Maybe I misunderstood your question.

-JTM


All times are GMT -5. The time now is 12:42 PM.

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