<%@ include file="header.html" %> <%@ import = "javax.mail.*,javax.mail.internet.*,javax.activation.*,java.net.InetAddress" %> <% boolean shouldShowFirstForm = true; String param_info[][] = { {"firmName", "Firm Name", "required", "You must enter your Firm Name"}, {"firstName", "First Name", "required", "You must enter your First Name"}, {"lastName", "Last Name", "required", "You must enter your Last Name"}, {"address1", "Address 1", "required", "You must enter your Address"}, {"address2", "Address 2", "not required", ""}, {"city", "City", "required", "You must enter your City"}, {"state", "State", "required", "You must enter your State"}, {"zip", "Zip Code", "required", "You must enter your Zip"}, {"phone", "Phone", "required", "You must enter your Phone Number"}, {"fax", "Fax", "required", ""}, {"email", "E-Mail", "required", "You must enter your E-Mail"}, {"purchaseprice", "Purchase Amount", "required", "You must enter the Purchase Amount"}, {"mortgage", "Loan Amount", "not required", ""}, {"addresspremises", "Address of Property", "required", "You must enter the address of the property being purchased."}, {"TaxBlock", "Tax Block", "not required", ""}, {"Lots", "Tax Lot", "not required", ""}, {"County", "County", "not required", "You must enter the county which the property is located in."}, {"Municipality", "Municipality", "not required", ""}, {"PresentOwnerName", "Present Owners Name", "not required", "You must enter the Present Owners Name."}, {"PresentOwnerMaidenName", "Present Owners Maiden Name", "not required", ""}, {"PurchaserName", "Purchaser's Name", "not required", "You must enter the Purchaser's Name."}, {"PurchaserMaidenName", "Purchaser's Maiden Name", "not required", ""}, {"LenderName", "Lender Name", "not required", "1"}, {"Lenderaddress1", " Lender Address", "not required", "2"}, {"Lenderaddress2", "Lender Address", "not required", "3"}, {"Lendercity", "Lender City", "not required", "4"}, {"Lenderstate", "Lender State", "not required", "5"}, {"Lenderzip", "Lender Zip Code", "not required", "6"}, {"survey", "Survey Information", "not required", "7"}, {"Flood", "Flood Information", "not required", "8"}, {"BackTitle", "Back Title", "not required", "9"}, {"Additional", "Additional Remarks", "not required", "10"}, }; if (request.getParameter("op") != null) { String errmsg = ""; for(int i = 0; i < param_info.length; i++) { if (param_info[i][2] == "required") { if ((request.getParameter(param_info[i][0]) == null) || (request.getParameter(param_info[i][0]).length() == 0)) { errmsg = errmsg.concat("
  • " + param_info[i][3]); } } } if (errmsg == "") { shouldShowFirstForm = false; } else { out.println(""); out.println(" "); out.println(" "); out.println(" "); out.println("
    Sorry Your Application Is Incomplete
    We are missing some required information from the form you submitted. The following is a list of corrections you must make before we can process your application. Please make the corrections to the form below and resend it.
    "); out.println("
      "); out.println(errmsg); out.println("
    "); out.println("
    "); out.println("

    "); } } %> <% if (shouldShowFirstForm == true) { %>

    Title Application:
    Attorney Information
    Firm Name:
    Contact Name:
    (First, Last)
    Address
     
    City/State/Zip
    Phone Fax
    E-Mail Address

    Policy Information
    Purchase Amount:
    Loan/Mortgage
    Amount
    Address of Premises:
    Tax Block: Lot(s):
    County: Municipality:
    Present Owner's Name:
    Maiden Name
    Purchaser's Name(s):
    Maiden Name

    Lender Information
    Lender Name:
    Address
     
    City/State/Zip
    Additional Information
    Survey Information: Please order a new Survey Old Survey with Affidavit
      Attorney to provide Not requested
    Flood Certificate to be ordered? Yes No
    Back Title: Enclosed Not Available
    Additional Information:

    <% } else { %> <% String mailhost = "couchnt03.couchbraunsdorf.com"; String msgfrom = request.getParameter("firstName") + " " + request.getParameter("lastName") + " <" + request.getParameter("email") + ">"; String msgto = "title@couchbraunsdorf.com"; String msgcc = null; String msgbcc = "info@couchbraunsdorf.com"; String msgsubject = "Title Application"; StringBuffer msgtext = new StringBuffer(); int maxlength = 0; for(int i = 0; i < param_info.length; i++) { if ((request.getParameter(param_info[i][0]) != null) && (request.getParameter(param_info[i][0]).length() != 0) && (param_info[i][1].length() > maxlength)) {maxlength = param_info[i][1].length();} } for(int i = 0; i < param_info.length; i++) { if ((request.getParameter(param_info[i][0]) != null) && (request.getParameter(param_info[i][0]).length() != 0)) { msgtext.append(param_info[i][1]); for(int j = 0; j < maxlength - param_info[i][1].length(); j++) {msgtext.append(" ");} msgtext.append(" - " + request.getParameter(param_info[i][0]) + "\n"); } } try { Properties props = System.getProperties(); if (mailhost != null) { props.put("mail.smtp.host", mailhost); } Session session = javax.mail.Session.getDefaultInstance(props, null); MimeMessage msg = new MimeMessage(session); msg.setFrom(new InternetAddress(msgfrom)); msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(msgto, false)); if (msgcc != null) { msg.setRecipients(Message.RecipientType.CC, InternetAddress.parse(msgcc, false)); } if (msgbcc != null) { msg.setRecipients(Message.RecipientType.BCC, InternetAddress.parse(msgbcc, false)); } msg.setSubject(msgsubject); msg.setText("A " + msgsubject + " was recieved on the Couch Braunsdorf Insurance Web site:\n\n" + msgtext.toString()); msg.setHeader("X-Mailer", "Revolutionary Systems"); msg.setSentDate(new Date()); Transport.send(msg); } catch (Exception e) { } msgfrom = "Couch Braunsdorf Title Insurance "; msgto = request.getParameter("email"); msgcc = null; msgbcc = null; msgsubject = "Title Insurance Application"; try { Properties props = System.getProperties(); if (mailhost != null) { props.put("mail.smtp.host", mailhost); } Session session = javax.mail.Session.getDefaultInstance(props, null); MimeMessage msg = new MimeMessage(session); msg.setFrom(new InternetAddress(msgfrom)); msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(msgto, false)); if (msgcc != null) { msg.setRecipients(Message.RecipientType.CC, InternetAddress.parse(msgcc, false)); } if (msgbcc != null) { msg.setRecipients(Message.RecipientType.BCC, InternetAddress.parse(msgbcc, false)); } msg.setSubject(msgsubject); msg.setText("Thank You for your recent request. For your records, here is the information you submitted\n\n" + msgtext.toString()); msg.setHeader("X-Mailer", "Revolutionary Systems"); msg.setSentDate(new Date()); Transport.send(msg); } catch (Exception e) { } %>
    Thank You
    You will be contacted shortly regarding your application by a representative within one business day. You will also shortly receive a message by e-mail confirm the contents of your application.
    <% } %><%@ include file="footer.jsp" %>