I am new very new to Java. I am trying to get the data from form and to email.
I am getting 3 fields of form two of them are String and one is array and want to store in one variable as to mail or print.
msg1 is String
msg2 is Array
msg3 is String
Now am trying to store like:
mailmsg=msg1+msg2+msg3;
System.out.println(mailmsg) this gt me the output msg1,last index of msg2 and msg3. I have problem with msg2 as this is array. How can I merge with
mailmsg=msg1+msg2+msg3;
Its Ok when there is a string but when array cames it became very difficuit for me to merge with string and mail it. Please check my following code
Thanks & best regards
Code:
String phone=req.getParameter("phone2");
String country=req.getParameter("country");
String[] btype=req.getParameterValues("btype");
msg1="<table border=0 cellpadding=4 align=center cellspacing=5 width=500>"+
"<tr><td class=khan><font color=red>Country</font></td><td class=khan>"+country+"</td></tr>"+
"<tr bgcolor=#EEEEEE><td class=khan><font color=red>Phone</font></td><td class=khan>"+phone+"</td></tr>";
msg2="<tr><td class=khan><font color=red>Business Type</font></td><td class=khan>";
for(i=0;i<btype.length;i++){
if(!btype[i].e[]quals("")){
btype[i]
}
}
msg3="</td></tr>";
mailmsg=msg1+msg2+msg3;
System.out.println(mailmsg);