You are here: Sign Up! / Set up your account
Step 2 of 3: Set up your account
<%@ 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 agreeEula = 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; } agreeEula = request.getParameter("agreeEula"); if (!(fullName == null | contactEmail == null | agreeEula == null | contactQuestion == null)) { doSubmit = true; String mailServer = "mail.livestoryboard.com"; String toEmail = "info@livestoryboard.com"; String subject = "liveSTORYBOARD Signup 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) { %><% } else { %>Thank you, <%=fullName%>!
We received your sign up request. One of us will be in touch within 24 hours to go through the details and get you started with liveSTORYBOARD CMS.
Thanks for choosing liveSTORYBOARD!
We are looking forward to working with you,
the liveSTORYBOARD team
