wood burning stoves 2.0*
The moose likes Servlets and the fly likes Sending emails with HTML or not? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sending emails with HTML or not?" Watch "Sending emails with HTML or not?" New topic
Author

Sending emails with HTML or not?

Jason Brawner
Ranch Hand

Joined: Dec 19, 2001
Posts: 66
I am developing an application which will send 1000's of emails (via JavaMail) and I'm debating on whether or not to send html in the email. I have two questions:
1. Do most email clients support html? Most of the recipients of the emails will be AOL, hotmail/msn, or yahoo clients. Are there any stats on how many people are running clients that don't support html?
2. The emails I send require an embedded image. Can I send an email with an image and it not be a html email? If so, how? A multipart email? If anybody has an example that would be great!
I'd prefer to not use HTML if possible.
Thanks,


Jason E. Brawner<br />Sun Certified Java Programmer<br />Sun Certified Web Component Developer
Jim Wang
Ranch Hand

Joined: Oct 04, 2001
Posts: 41
Hi, Jason:
I have an application, which needs to send feedback to client. Since I can figure out the email address of my clients, I think that would be good to send beedback by email, but I don't know how. Would you give a hint of how to do this?
Thanks.
Jim
Prashanth menon
Ranch Hand

Joined: Feb 20, 2001
Posts: 65
Email can be sent in HTML format from javaMail by setting the contenttype of the message as text/html
Most email clients accept the html contents including the image. I recive mails in outlook as well as the hotmail which are in html.
regds
Prashanth
Zakaria Haque
Ranch Hand

Joined: Jan 02, 2002
Posts: 60
Originally posted by Jason Brawner:

2. The emails I send require an embedded image. Can I send an email with an image and it not be a html email? If so, how? A multipart email? If anybody has an example that would be great!

what you mean by embedded image? You can send attachment in a multipart message.


tobe bondhu nouka bherao<br />shonabo gaan aj shara raat
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

1. I think most clients support it, but equally, most people seem annoyed by it. Especially *nix users.

2. Yes, you could send it multipart through JavaMail. There are pretty good examples in Appendix B of the "JavaMail API Design Specification" pdf document, available from java.sun.com/products/javamail/JavaMail-1.2.pdf

Note, that's the API *spec* and not the API.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending emails with HTML or not?