• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: sending html in email
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sending html in email


  • Subject: Re: sending html in email
  • From: "Daniele Corti" <email@hidden>
  • Date: Mon, 19 Mar 2007 09:33:58 +0100



2007/3/19, Anthony Arthur <email@hidden>:
Using javax.mail

-b

Bah, in Project Wonder you can use ERMailDeliverHTML to deliver html mail without problem... but if you don't use it, look at this:
http://www.rgagnon.com/javadetails/java-0504.html

Hope this work, (I've found it, but I've never use it, sorry...)
On Mar 18, 2007, at 9:12 PM, Pascal Robert wrote:

Do yourself a flavor, use ERJavaMail from Wonder.

Which class is your email variable, MimeMessage from JavaMail ?  If yes, you should use the setText() method with 3 arguments :

http://java.sun.com/products/javamail/javadocs/index.html

public void setText(java.lang.String text,
                    java.lang.String charset,
                    java.lang.String subtype)
             throws MessagingException

For the type, use "html".  The method you use is sending a text/plain MIME type, so it's normal that you see your HTML code instead of the rendered HTML.


Hi,

Searching the archives I am not finding a match, but just wondering how do I send html in the body of an email message so that it will render as though it were in a browser.  My code looks like:

WOComponent banner = pageWithName( "EmailContentPage");
WOResponse response;

((EmailContentPage)banner).emailMessage = "This is your password: " + user.password() + ".   You will be prompted for a new password the next time you log in. ";

response = banner.generateResponse();

email.setText("Content-Type: text/html; charset=\"" + "iso-8859-1" + "\"" + "\n\n" +response.contentString());

It just renders as raw html in the body of the email message..., must be something simple that I am forgetting.  Can someone offer a clue?



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (



--
Daniele Corti
AIM: S0CR4TE5
Messenger: email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: sending html in email
      • From: Jeff Schmitz <email@hidden>
References: 
 >sending html in email (From: Anthony Arthur <email@hidden>)
 >Re: sending html in email (From: Pascal Robert <email@hidden>)
 >Re: sending html in email (From: Anthony Arthur <email@hidden>)

  • Prev by Date: Re: Partially saving the object graph. How?
  • Next by Date: XML, RSS, Deployment
  • Previous by thread: Re: sending html in email
  • Next by thread: Re: sending html in email
  • Index(es):
    • Date
    • Thread