[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Searching for examples of how to convert html to ascii for java multi-part emails

Posted on 2010-01-08
9
Medium Priority
?
357 Views
Last Modified: 2013-11-24
We use javamail and jakarta commons to send html email.   However, a small number of users only support ascii email.  I am seeking  way to automate the need to send two formats of each email, html and ascii, rather than having to draft the content of each format manually.

are there any libraries or sample code that will convert a well structured html string into ascii?   I have seen such examples in PHP but nothing in Java.   Ideally, it would degrade gracefully, putting astericks in place of <strong>, convert tables (as best possible), safely handling long urls when ascii readers often break strings longer than 80 characters, to ascii-boxes, etc.
0
Comment
Question by:stevelopez
  • 5
  • 4
9 Comments
 
LVL 83

Expert Comment

by:leakim971
ID: 26245690
Hello stevelopez,

HTML to plain-text :
http://www.example-code.com/java/htmlToText_simple.asp

Regards.
0
 

Author Comment

by:stevelopez
ID: 26247386
this may work, though I am hoping for an open source version since this is code will run in a production environment and provides sandbox access to email servers. [e.g. potentially security risk with unknown code]
0
 

Author Comment

by:stevelopez
ID: 26248000
After researching Chilkat a bit further it looks like it isn't a viable option for this application.  I found multiple reviews that discredit the company's support and quality (http://download.cnet.com/Chilkat-NET-Email-Component-2-0-Framework/3000-10250_4-10562450.html#rateit).  

Possible solutions (or 3rd party libraries) do not need to be free but need to include source.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:stevelopez
ID: 26272971
leakim971:

OnlyText looks like it would work.  However, it is no where to be found in the James downloads.  I've searched through the James server source as well as the Mailet (base) and Mailet  jar files and OnlyHtml.java is isn't listed under the org.apache.james.transport.mailets package.

have you used this personally or know where, specifically, it can be found?

Thanks,
Steve
0
 
LVL 83

Expert Comment

by:leakim971
ID: 26273173
0
 

Author Comment

by:stevelopez
ID: 26273221
leakim971:

apologies but I'm still not finding the actual java file (or .class for that matter).    I looked in the Apache Mailet JAR files http://www.eng.lsu.edu/mirrors/apache/james/apache-mailet/2.4/apache-mailet-2.4-src.zip   and nothing there by the name OnlyText.java.   I saw a reference to the file in the 'RAT' file but not knowing anything about RAT I wasn't sure how to deduce which JAR file the .java is built into.
0
 
LVL 83

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 26273390
0
 
LVL 83

Expert Comment

by:leakim971
ID: 26273700
Thanks for the points!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses
Course of the Month20 days, 3 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question