Dear Friends,
I would like to retrieve email address from database, but I am not be able to get the value and store into my
Sender. When I hardcode my email, it can send out the mail successfully, but when I use SQL to retrieve, it cannot run. Pls help...
\\Define Variable
<%String Tabcont="", dte="",Subject="", ln_num ="",remark="",pur="",in_desc_combine
="",mtr_cde
="",selectExceed1="",seqDftran="",Body="";
String Rej="";
double qty=0;
String emailadd="", Sender="",Recipient="";%>
\\SQL query
String emailaddSender=" SELECT em_email_addr FROM emmast "+
" WHERE em_name = '"+ whoReject+"' ";
ResultSet emSender = null;
try {emSender = db.execSQL(emailaddSender);}
catch (SQLException e)
{System.err.println("Error-123");}
if(emSender.next()){
Sender=emSender.getString("em_email_addr");}
\\pass in parameter
checkstatus();
{
<%if (rec_status.equals("R"))%>
<%{%>
<%send.sending(SMTPServer,Sender,Recipient,CcRecipient,BccRecipient,Subject,Body,Attachments);%>
<%}%>
}
**I am not sure what is the mistake I did in my sql query, please help
Thank You