how to sending checkbox list ( checklist ) in an email on jsp ?

hi alli have a checklist ( with checkboxes) made in a jsp page. then i want to send the checklist ( along with the checkboxes) in an email jsp page . how can i do that?thank u
[196 byte] By [jazzsa] at [2007-11-27 1:33:25]
# 1
You can use the javax.mail API to send an email.
BalusCa at 2007-7-12 0:39:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
yes.currently im using JavaMAil..but still wondering how to send the list of checkboxes along with the message body?have been looking for solutions...could not match any with my problems.
jazzsa at 2007-7-12 0:39:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Just as a String?
BalusCa at 2007-7-12 0:39:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Or if you wanted to get fancy, you could send an HTML e-mail and include the same HTML that is in the JSP. Or at least, the part containing the checkboxes.
DrClapa at 2007-7-12 0:39:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

DrClap,

could u pls explain more or is there a site that i can refer to?

i want to send the checkboxes as checkboxes.

at the moment, im trying to create a class to create the checklist panel.

im thinking if i could embed the class object in the mail...

is it possible?

jazzsa at 2007-7-12 0:39:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
Then this will still be sent as a String ;) With String I meant java.lang.String, not text/plain.
BalusCa at 2007-7-12 0:39:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

> i want to send the checkboxes as checkboxes.

>

> at the moment, im trying to create a class to create

> the checklist panel.

> im thinking if i could embed the class object in the

> mail...

> is it possible?

Yes, it is possible. Just catch the String output of this class creating the panel.

BalusCa at 2007-7-12 0:39:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8

Checklistpanel cl = new Checklistpanel(values);

Message msg = new MimeMessage(mailSession);

msg.setFrom(new InternetAddress(from));

InternetAddress[] address = {new InternetAddress(to)};

msg.setRecipients(Message.RecipientType.TO, address);

msg.setSubject(subject);

msg.setSentDate(new Date());

msg.setText(messageText);

msg.setContent(cl,"string")

correct me if im wrong,

ill be using the setContent method to embed the object,right?

and the string param is referring to?

jazzsa at 2007-7-12 0:39:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9

Have you tried it anyway? This will not work :)

This just depends on the mimetype you've set. The mimetype "string" is unknown.

Use mimetype "text/plain" or "text/html" and put the String in the content.

You can find here all mime types: http://www.w3schools.com/media/media_mimeref.asp

Or did you expect that the mail contains a hidden API which converts Objects to human readable Strings automatically?

BalusCa at 2007-7-12 0:39:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10

no i havent actually ran the code yet coz the mail server is not up yet...

thought i settle this prob first...

so, guess ill be using the text/html mimetype, right?

because ill be sending the list of checkboxes.

will i be sending in html format or as java object , like i was planning earlier?

is there any sample codes to do this? id appreciate it.

sorry, if i question too much...but this is my 1st time building a web mail app.

is there any good tutorial that will help?

jazzsa at 2007-7-12 0:39:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 11

You can use the smtp server of your ISP temporary. Be sure to provide your own mailaddress from the ISP as the "from".

Converting Objects to Strings isn't that hard .. Use the Object's methods to get some values and eventually append some String values in that format of which you think that the final picture is human readable ;)

Hint: how did you wrote the checkbox in the JSP page? Do it the same way.

BalusCa at 2007-7-12 0:39:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...