File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Appending HTML formatted text in an Email Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Appending HTML formatted text in an Email" Watch "Appending HTML formatted text in an Email" New topic
Author

Appending HTML formatted text in an Email

vishwanath nadimpally
Ranch Hand

Joined: Jan 25, 2005
Posts: 116
Hello all,

I am creating an 'EMAIL PAGE' link on our website and would like to append the whole page that is to be emailed in to outlook express. I posted the same question some time back and didn't phrase it properly and didn't get any responses.

I am looking to write a java class to which I can pass the whole jsp or what ever I want to email as a String parameter and then in the java class I will parse out the tags and will replace them with the "named entities" (i.e. &space; & &newline; etc.) and "ascii" (i.e. %0D, %0A, etc) and plain "html tags" (body="<HTML> <HEAD></HEAD><BODY> etc.)

So my question is if this is a good approach. I tried using the 'mailto' tag and appended a 'body' string with the above mentioned tags, and it did not work. So will the new idea work? if not how to make it work?

Thanks for any suggestions.
[ September 29, 2006: Message edited by: vishwanath nadimpally ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

I'm a bit confused as to what you are trying to do.

Do you want to send the mail from the web app? or have pre-formatted mail appear in the user's Outlook instance for them to send? (not receive)


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
vishwanath nadimpally
Ranch Hand

Joined: Jan 25, 2005
Posts: 116
Originally posted by Bear Bibeault:
I'm a bit confused as to what you are trying to do.

Do you want to send the mail from the web app? or have pre-formatted mail appear in the user's Outlook instance for them to send? (not receive)


When ever a user clicks on the 'Email Page' link which sits on every web page on the website, the Outlook Express should open with the contents of that webpage.

I am also going to use this functionality for things like posting online resumes, where I can have the user click a link and the outlook express brings up a pre-fomatted resume where they fill out the fields and email the resume.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

Does it have to be through Outlook? It'd be pretty easy to do this if you did everything through web pages.
vishwanath nadimpally
Ranch Hand

Joined: Jan 25, 2005
Posts: 116
Originally posted by Bear Bibeault:
Does it have to be through Outlook? It'd be pretty easy to do this if you did everything through web pages.



The 'email page' doesn't have to be through Outlook. But it would bring up the email client as i am using 'mailto' tag for resum`e submission page.

I am half-way through successfully. I ve been able to create a java class which can render html inside the email body. I have successfully appended images in my HTML too, pointing them to a fully qualified web-address. But the biggest challenge is to bring the contents of every web-page as it is.

I am stuck here.. is there a way to do this?

[ September 29, 2006: Message edited by: vishwanath nadimpally ]
[ September 29, 2006: Message edited by: vishwanath nadimpally ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

But it would bring up the email client as i am using 'mailto'


Oh well. Then this is as far as I can help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Appending HTML formatted text in an Email
 
Similar Threads
bizarre object error
Struts 2 newbie problem
DWR - Not returning search results
jsp error handling
org.apache.jasper.JasperException: java.lang.ArrayIndexOutOfBoundsException: 8