Contact Us
<%@ page import="java.io.*"%><%@ page import="java.util.*"%><%@ page import="org.apache.commons.net.smtp.*"%><%@ page import="java.net.SocketException"%><% String fullName = null; String contactEmail = null; String contactQuestion = null; boolean error = false; boolean doSubmit = false; boolean doSend = false; if (request.getParameter("send") != null) { doSend = true; } if (doSend) { contactQuestion = request.getParameter("contactQuestion"); contactQuestion = contactQuestion.toLowerCase(); String clr="orange"; if (!(contactQuestion.equals(clr))) { contactQuestion = null; } fullName = request.getParameter("FullName"); if (fullName.equals("")) { fullName = null; } contactEmail = request.getParameter("Email"); if (contactEmail.equals("")) { contactEmail = null; } if (!(fullName == null | contactEmail == null | contactQuestion == null)) { doSubmit = true; String mailServer = "mail.livestoryboard.com"; String toEmail = "info@livestoryboard.com"; String subject = "liveSTORYBOARD Contact Request"; SMTPClient client = new SMTPClient(); try { client.connect(mailServer, 25); } catch (SocketException se) { throw new ServletException(new Throwable( "Could not connect to email server.")); } catch (IOException ioe) { throw new ServletException(new Throwable( "Could not connect to email server.")); } int reply = client.getReplyCode(); if (!SMTPReply.isPositiveCompletion(reply)) { try { client.disconnect(); } catch (IOException ioe) { } //response.sendRedirect("Error.jsp?error=0"); } else { StringBuffer sb = new StringBuffer(); String newLine = "\r\n"; String equals = " = "; Enumeration enum = request.getParameterNames(); sb.append("-------------- Form Information ----------------"); sb.append(newLine); sb.append(newLine); String name = null; while (enum.hasMoreElements()) { name = (String) enum.nextElement(); sb.append(name); sb.append(equals); sb.append(request.getParameter(name)); sb.append(newLine); sb.append(newLine); } sb.append(newLine); sb.append(newLine); sb.append("-------------- Client Information ----------------"); sb.append(newLine); sb.append(newLine); sb.append("Refering URI"); sb.append(equals); sb.append(request.getHeader("Referer")); sb.append(newLine); sb.append("RequestURI"); sb.append(equals); sb.append(request.getRequestURI()); sb.append(newLine); sb.append("Locale"); sb.append(equals); sb.append(request.getLocale()); sb.append(newLine); sb.append("RemoteAddress"); sb.append(equals); sb.append(request.getRemoteAddr()); sb.append(newLine); sb.append("RemoteHost"); sb.append(equals); sb.append(request.getRemoteHost()); try { client.login(mailServer); client.setSender(toEmail); client.addRecipient(toEmail); PrintWriter writer = new PrintWriter(client.sendMessageData()); SimpleSMTPHeader header = new SimpleSMTPHeader(toEmail, toEmail, subject); writer.write(header.toString()); writer.write(sb.toString()); writer.close(); boolean isCompleted = client.completePendingCommand(); if (client.isConnected()) { client.logout(); client.disconnect(); } } catch (IOException ioe) { try { if (client.isConnected()) { client.logout(); client.disconnect(); } } catch (IOException ioe2) { throw new ServletException(new Throwable( "Could not disconnect client.")); } throw new ServletException(new Throwable( "Could not connect to email server.")); } } } } if (!doSubmit) { %>You can help us better understand your specific needs by providing as much detail as you can, but only the fields marked with * are required.
We respect your privacy and will never share your private information with anyone without your explicit permission! (We hate spam!)
Please enter your name.
<% } if (doSend && contactEmail == null) { %>Please enter your email address.
<% } if (doSend && contactQuestion == null) { %>Please answer the last question below - we know it's inconvenient, but it helps us fight spam.
<% } %><% } else { %>Thank you, <%=fullName%>!
We received your contact info. One of us will be in touch within a day (or most likely sooner).
We are looking forward to helping you make your site a success!
the liveSTORYBOARD team
liveSTORYBOARD Inc.
address: 336 Bon Air Center, Greenbrae, CA 94904
tel: (415) 755-7558
email: info@livestoryboard.com








