Re: sending html in email
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>:
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 :
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