%@ page language = "java" import="java.sql.*,java.text.*,java.util.*,java.net.*,java.io.*,poolcon.*,mailservs.*"%>
<%@ taglib uri="http://jakarta.apache.org/taglibs/image-1.0" prefix="img" %>
<%
/*
@ rajeev gupta
* All variables start with s are string type
* All variables start with n are integer type
* All variables start with d are double type
*/
Properties props = new Properties();
String rootpath=request.getContextPath();;
Connection conn = null;
ResultSet rs = null;
Statement st=null;Statement st1=null;
ResultSet rs1 = null;
try{
javax.naming.Context initContext = new javax.naming.InitialContext();
javax.naming.Context envContext = (javax.naming.Context)initContext.lookup("java:/comp/env");
javax.sql.DataSource ds = (javax.sql.DataSource)envContext.lookup("jdbc/wms");
conn = ds.getConnection();
st = conn.createStatement();st1 = conn.createStatement();
String s_hidfld = request.getParameter("hidfld");boolean flag=true;
String s_custId="",s_custIdp="",s_emailId="",s_emailIdp="";
if(s_hidfld != null){
s_emailId= request.getParameter("emailId").trim();
s_emailIdp=s_emailId;
if(s_emailId.equals("")){
s_emailId= "Enter E-mail Id";
flag=false;
}else{
validate.setValueForEmails(s_emailId);
s_emailId=validate.getValueForEmails();
if(!s_emailId.equals("")){
flag=false;
}else{
rs = st.executeQuery("SELECT * from ca_customer_details where email = '"+s_emailIdp+"'");
if(rs.next()){
String FromEmail="sd@gscpl.com";
String Subject="Canon Customer Service Id";
String MessVal="Dear "+rs.getString("name")+"\n\nYour Canon Customer Service Id is: "+rs.getString("customer_id")+"\n\n\nPlease do not reply to this e-Mail.For any of your concerns please contact Canon Customer Care.";
String SendEmail=rs.getString("email");
mail.mailServ(SendEmail,FromEmail,Subject,MessVal);
s_emailId="Customer Service Id will be sent to your E-mail.";
}else{
s_emailId="Email Id is not registered with us.";
flag=false;
}
}
}
}
%>
<%
}catch(SQLException sqe){
out.println(sqe.getMessage());
}catch(Exception ex){
out.println(ex.getMessage());
}
finally
{
try
{
if(rs!= null){rs.close();rs=null;}
if(st!= null){st.close();st=null;}
if(conn!=null){conn.close(); conn=null;}
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
%>