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?
> 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.
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?
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?
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?
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.