Exemplo n.º 1
0
  public void sendSmtpTestMail(
      String smtpFromMail,
      String smtpHost,
      Integer smtpPort,
      String smtpUsername,
      String smtpPassword,
      String toMail) {
    SystemConfig systemConfig = SystemConfigUtil.getSystemConfig();
    MailConfig mailConfig = TemplateConfigUtil.getMailConfig(MailConfig.SMTP_TEST);
    String subject = mailConfig.getSubject();
    String templateFilePath = mailConfig.getTemplateFilePath();
    try {
      email = new HtmlEmail();
      email.setHostName(systemConfig.getSmtpHost());
      email.setSmtpPort(systemConfig.getSmtpPort());
      email.setAuthenticator(
          new DefaultAuthenticator(systemConfig.getSmtpUsername(), systemConfig.getSmtpPassword()));
      email.setSSLOnConnect(true);

      WebAppResourceLoader resourceLoader = new WebAppResourceLoader();
      Configuration cfg = Configuration.defaultConfiguration();
      GroupTemplate gt = new GroupTemplate(resourceLoader, cfg);
      Template template = gt.getTemplate(templateFilePath);
      template.binding("systemConfig", systemConfig);
      String text = template.render();

      email.setFrom(
          MimeUtility.encodeWord(systemConfig.getShopName())
              + " <"
              + systemConfig.getSmtpFromMail()
              + ">");
      email.setSubject(subject);
      email.setMsg(text);
      email.addTo(toMail);
      email.send();

    } catch (EmailException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
Exemplo n.º 2
0
  public boolean sendMail(
      String subject, String templateFilePath, Map<String, Object> data, String toMail) {
    boolean isSend = false;
    try {
      SystemConfig systemConfig = SystemConfigUtil.getSystemConfig();

      email = new HtmlEmail();
      email.setHostName(systemConfig.getSmtpHost());
      email.setSmtpPort(systemConfig.getSmtpPort());
      email.setAuthenticator(
          new DefaultAuthenticator(systemConfig.getSmtpUsername(), systemConfig.getSmtpPassword()));
      email.setSSLOnConnect(true);

      WebAppResourceLoader resourceLoader = new WebAppResourceLoader();
      Configuration cfg = Configuration.defaultConfiguration();
      GroupTemplate gt = new GroupTemplate(resourceLoader, cfg);
      Template template = gt.getTemplate(templateFilePath);
      template.binding(data);
      String text = template.render();

      email.setFrom(
          MimeUtility.encodeWord(systemConfig.getShopName())
              + " <"
              + systemConfig.getSmtpFromMail()
              + ">");
      email.setSubject(subject);
      email.setMsg(text);
      email.addTo(toMail);
      email.send();
      isSend = true;
    } catch (EmailException e) {
      e.printStackTrace();
    } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
    return isSend;
  }
  public boolean sendRegistartionConfirmationMail(QuasarMailConfiguration qmc, String... emailids) {
    try {
      HtmlEmail email = new HtmlEmail();
      email.setHostName(qmc.getHost());
      email.setSmtpPort(Integer.parseInt(qmc.getPort()));
      email.setAuthentication(qmc.getAdimnusername(), qmc.getAdminpassword());
      email.setSSLOnConnect(Boolean.parseBoolean(qmc.getStarttls()));

      email.setFrom(qmc.getAdimnusername());

      email.setSubject("TestMail");

      // MailChimp
      // email.setHtmlMsg("<!DOCTYPE html><html><head><meta charset=\"ISO-8859-1\"><title>Insert
      // title here</title></head><body><table id=\"studentdetail\" style=\"background-color:
      // graytext;font-family: sans-serif;padding: 10px;-webkit-border-radius:
      // 4px;-moz-border-radius: 4px;border-radius: 4px;box-shadow: 0 4px 4px -4px rgba(0, 0, 0,
      // 0.7);-moz-box-shadow: 0 4px 4px -4px rgba(0, 0, 0, 0.7);-webkit-box-shadow: 0 4px 6px -5px
      // rgba(0, 0, 0, 0.8);\"><tr><td align=\"center\"><img alt=\"alt\"
      // src=\"images/logo.png\"></td><td align=\"left\">CMC LTD,New Delhi,Near Kohat Enclave Metro
      // Station</td></tr><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p>Grettings, Thanks for registering
      // at CMC Delhi. We wish you a prosperous learning.If you any query click on this link <a
      // href=\"www.cmcdelhi.com\">Link</a></p></td></tr></table></body></html>");
      email.setHtmlMsg(
          "<!DOCTYPE html><html><head><meta charset=\"ISO-8859-1\"><title>Insert title here</title></head><body>"
              + "<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"100%\" width=\"100%\" style=\"border-collapse:collapse;margin:0;padding:0;background-color:#f2f2f2;height:100%!important;width:100%!important\"><tbody><tr><td align=\"center\" valign=\"top\" style=\"margin:0;padding:0;border-top:5px none #aaaaaa;height:100%!important;width:100%!important\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-collapse:collapse\"><tbody>"
              + "<tr><td align=\"center\" valign=\"top\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-collapse: collapse; background-color: #ffffff; border-top: 0; border-bottom: 0\"><tbody><tr><td align=\"center\" valign=\"top\">"
              + "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\"style=\"border-collapse: collapse\"><tbody>	<tr><td valign=\"top\" style=\"padding-top: 10px; padding-bottom: 10px\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-collapse: collapse\">"
              + "<tbody><tr><td valign=\"top\" style=\"padding: 9px\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"width=\"100%\" style=\"border-collapse: collapse\"><tbody><tr><td valign=\"top\" style=\"padding: 9px\"><table align=\"left\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\"><tbody><tr><td valign=\"top\"><ahref=\"http://www.cmcdelhi.com/\" "
              + "title=\"\" style=\"word-wrap: break-word\" target=\"_blank\"><img alt=\"\" src=\"https://ci6.googleusercontent.com/proxy/RuvteIJkgNFYdxI6145X-lK4685AcOQxFui4iZxVKwtCz-hegVDIxdtSQ5PaGoE4fLQ_CR3uYlTuRNK8beuUu2loSM5gODacK1JsUqlEZ2lW2plIlZyyKfBPpqg6wpNywbTmDYca7UhlSa20h1k82LH1zIrVEMkqneme9Q=s0-d-e1-ft#http://gallery.mailchimp.com/38e8f39f127b52b8859e52f7c/images/4ea87a8b-6945-477c-904b-bbce8bf80a91.jpg\" width=\"116\" style=\"max-width: 116px; border: 0; outline: none; text-decoration: none; vertical-align: bottom\"></a></td></tr></tbody></table><table align=\"right\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"176\"style=\"border-collapse: collapse\"><tbody><tr><td valign=\"top\" style=\"font-family: Georgia, Times, 'Times New Roman', serif; font-size: 9px; font-style: normal; text-align: center; color: #606060; line-height: 150%\"><spanstyle=\"color: #000000; font-family: arial, helvetica, clean, sans-serif; font-size: small; line-height: 16.003000259399414px; text-align: -webkit-center\">8,Vaishali Enclave,Main Metro Road,&nbsp;</span><br style=\"font-size: small; color: #000000; font-family: arial, helvetica, clean, sans-serif; line-height: 16.003000259399414px; text-align: -webkit-center\">"
              + "<span style=\"color: #000000; font-family: arial, helvetica, clean, sans-serif; font-size: small; line-height: 16.003000259399414px; text-align: -webkit-center\">PitamPura,(Opp. Metro Pillar No. 351), New Delhi-110034,</span><br style=\"font-size: small; color: #000000; font-family: arial, helvetica, clean, sans-serif; line-height: 16.003000259399414px; text-align: -webkit-center\"><span style=\"color: #000000; font-family: arial, helvetica, clean, sans-serif; font-size: small; line-height: 16.003000259399414px; text-align: -webkit-center\">India</span></td></tr></tbody>	</table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr>"
              + "<tr><td align=\"center\" valign=\"top\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-collapse:collapse;background-color:#ffffff;border-top:0;border-bottom:0\"><tbody><tr><td align=\"center\" valign=\"top\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"border-collapse:collapse\"><tbody><tr><td valign=\"top\" style=\"padding-top:10px;padding-bottom:10px\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-collapse:collapse\"><tbody><tr><td valign=\"top\"><table align=\"left\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"border-collapse:collapse\"><tbody><tr> <td valign=\"top\" style=\"padding:9px 18px;font-size:9px;color:#606060;font-family:Helvetica;line-height:150%;text-align:left\">"
              + "<h1 style=\"margin:0;padding:0;display:block;font-family:Helvetica;font-size:32px;font-style:normal;font-weight:bold;line-height:125%;letter-spacing:-1px;text-align:left;color:#606060!important\">Greetings From CMC Delhi</h1><h3 style=\"margin:0;padding:0;display:block;font-family:Helvetica;font-size:14px;font-style:normal;font-weight:bold;line-height:125%;letter-spacing:-.5px;text-align:left;color:#606060!important\">Registration Confirmation Email</h3><p style=\"margin:1em 0;padding:0;color:#606060;font-family:Helvetica;font-size:15px;line-height:150%;text-align:left\">Thanks for registering at CMC Delhi.This is system generated mail confirming your registration for course #####.Wishing you a prosperous learning.<br>Get your payment details here &lt;a href=\"<a href=\"http://www.cmcdelhi.com\" target=\"_blank\">www.cmcdelhi.com</a>\"</p>"
              + "<p style=\"margin:1em 0;padding:0;color:#606060;font-family:Helvetica;font-size:15px;line-height:150%;text-align:left\">Need inspiration for your design? <a href=\"http://inspiration.mailchimp.com\" style=\"word-wrap:break-word;color:#6dc6dd;font-weight:normal;text-decoration:underline\" target=\"_blank\">Here�s what other MailChimp users are doing.</a></p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr>"
              + "<tr><td align=\"center\" valign=\"top\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-collapse:collapse;background-color:#f2f2f2;border-top:0;border-bottom:0\"><tbody><tr><td align=\"center\" valign=\"top\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"border-collapse:collapse\"><tbody><tr><td valign=\"top\" style=\"padding-top:10px;padding-bottom:10px\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-collapse:collapse\"><tbody><tr><td valign=\"top\"><table align=\"left\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"border-collapse:collapse\"><tbody><tr>"
              + "<td valign=\"top\" style=\"padding-top:9px;padding-right:18px;padding-bottom:9px;padding-left:18px;color:#606060;font-family:Helvetica;font-size:11px;line-height:125%;text-align:left\"><em>Copyright � *|####YEAR#####|* CMC Delhi, All rights reserved.</em><br><br><strong>Our address :</strong><br><span style=\"color:#000000;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center\">8,Vaishali Enclave,Main Metro Road,&nbsp;</span><br style=\"color:#000000;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center\"><span style=\"color:#000000;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center\">"
              + "Pitam Pura,(Opp. Metro Pillar No. 351), New Delhi-110034,</span><br style=\"color:#000000;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center\"><span style=\"color:#000000;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center\">India</span><br><strong style=\"color:#000000;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center\">For Corporate Queries/College Tie-ups :&nbsp;Ashish Arora&nbsp; (09810324822)&nbsp;</strong><br style=\"color:#000000;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center\">"
              + "<strong style=\"color:#000000;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center\">For Student Queries:&nbsp;</strong><span style=\"color:#000000;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center\">Ms. Sabia Rais / Ms. Priyanka:09313877528, 01165905335 &amp; 65655335</span><br><strong style=\"color:#000000;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center\">E-mail:</strong><a href=\"mailto:[email protected]\" style=\"color:blue;text-decoration:none;font-weight:bold;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center;word-wrap:break-word\" target=\"_blank\">"
              + "[email protected]</a><span style=\"color:#000000;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center\">/</span><a href=\"mailto:[email protected]\" style=\"color:blue;text-decoration:none;font-weight:bold;font-family:arial,helvetica,clean,sans-serif;font-size:small;line-height:16.003000259399414px;text-align:-webkit-center;word-wrap:break-word\" target=\"_blank\">ashis<wbr>[email protected]</a><br>&nbsp;</td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr>"
              + "</tbody></table></body></html>");
      // /Email Attachment
      // EmailAttachment attachment = new EmailAttachment();
      // attachment.setPath("/home/guffy/Pictures/fggsa.jpg");
      // attachment.setDisposition(EmailAttachment.ATTACHMENT);
      // attachment.setDescription("Picture of JMosque");
      // attachment.setName("Mousque");

      // email.attach(attachment);

      // set the alternative message
      email.setTextMsg("Your email client does not support HTML messages");

      // adding up the recivers
      for (String em : emailids) {
        // email.addTo("*****@*****.**");
        email.addTo(em);
      }

      email.send();

      return true;

    } catch (EmailException e) {
      Log.e("Email Exception : " + e.getMessage());

    } catch (Exception e) {
      Log.e("Exception : " + e.getMessage());
    }
    return false;
  }
Exemplo n.º 4
0
  public static void sendResetPwdMail(String appCode, ODocument user) throws Exception {
    final String errorString = "Cannot send mail to reset the password: "******" invalid user object");

    // initialization
    String siteUrl = Application.NETWORK_HTTP_URL.getValueAsString();
    int sitePort = Application.NETWORK_HTTP_PORT.getValueAsInteger();
    if (StringUtils.isEmpty(siteUrl))
      throw new PasswordRecoveryException(errorString + " invalid site url (is empty)");

    String textEmail = PasswordRecovery.EMAIL_TEMPLATE_TEXT.getValueAsString();
    String htmlEmail = PasswordRecovery.EMAIL_TEMPLATE_HTML.getValueAsString();
    if (StringUtils.isEmpty(htmlEmail)) htmlEmail = textEmail;
    if (StringUtils.isEmpty(htmlEmail))
      throw new PasswordRecoveryException(errorString + " text to send is not configured");

    boolean useSSL = PasswordRecovery.NETWORK_SMTP_SSL.getValueAsBoolean();
    boolean useTLS = PasswordRecovery.NETWORK_SMTP_TLS.getValueAsBoolean();
    String smtpHost = PasswordRecovery.NETWORK_SMTP_HOST.getValueAsString();
    int smtpPort = PasswordRecovery.NETWORK_SMTP_PORT.getValueAsInteger();
    if (StringUtils.isEmpty(smtpHost))
      throw new PasswordRecoveryException(errorString + " SMTP host is not configured");

    String username_smtp = null;
    String password_smtp = null;
    if (PasswordRecovery.NETWORK_SMTP_AUTHENTICATION.getValueAsBoolean()) {
      username_smtp = PasswordRecovery.NETWORK_SMTP_USER.getValueAsString();
      password_smtp = PasswordRecovery.NETWORK_SMTP_PASSWORD.getValueAsString();
      if (StringUtils.isEmpty(username_smtp))
        throw new PasswordRecoveryException(errorString + " SMTP username is not configured");
    }
    String emailFrom = PasswordRecovery.EMAIL_FROM.getValueAsString();
    String emailSubject = PasswordRecovery.EMAIL_SUBJECT.getValueAsString();
    if (StringUtils.isEmpty(emailFrom))
      throw new PasswordRecoveryException(errorString + " sender email is not configured");

    try {
      String userEmail =
          ((ODocument) user.field(UserDao.ATTRIBUTES_VISIBLE_ONLY_BY_THE_USER))
              .field("email")
              .toString();

      String username = (String) ((ODocument) user.field("user")).field("name");

      // Random
      String sRandom = appCode + "%%%%" + username + "%%%%" + UUID.randomUUID();
      String sBase64Random = new String(Base64.encodeBase64(sRandom.getBytes()));

      // Save on DB
      ResetPwdDao.getInstance().create(new Date(), sBase64Random, user);

      // Send mail
      HtmlEmail email = null;

      URL resetUrl =
          new URL(
              Application.NETWORK_HTTP_SSL.getValueAsBoolean() ? "https" : "http",
              siteUrl,
              sitePort,
              "/user/password/reset/" + sBase64Random);

      // HTML Email Text
      ST htmlMailTemplate = new ST(htmlEmail, '$', '$');
      htmlMailTemplate.add("link", resetUrl);
      htmlMailTemplate.add("user_name", username);

      // Plain text Email Text
      ST textMailTemplate = new ST(textEmail, '$', '$');
      textMailTemplate.add("link", resetUrl);
      textMailTemplate.add("user_name", username);

      email = new HtmlEmail();

      email.setHtmlMsg(htmlMailTemplate.render());
      email.setTextMsg(textMailTemplate.render());

      // Email Configuration
      email.setSSL(useSSL);
      email.setSSLOnConnect(useSSL);
      email.setTLS(useTLS);
      email.setStartTLSEnabled(useTLS);
      email.setStartTLSRequired(useTLS);
      email.setSSLCheckServerIdentity(false);
      email.setSslSmtpPort(String.valueOf(smtpPort));
      email.setHostName(smtpHost);
      email.setSmtpPort(smtpPort);

      if (PasswordRecovery.NETWORK_SMTP_AUTHENTICATION.getValueAsBoolean()) {
        email.setAuthenticator(new DefaultAuthenticator(username_smtp, password_smtp));
      }
      email.setFrom(emailFrom);
      email.addTo(userEmail);

      email.setSubject(emailSubject);

      if (Logger.isDebugEnabled()) {
        StringBuilder logEmail =
            new StringBuilder()
                .append("HostName: ")
                .append(email.getHostName())
                .append("\n")
                .append("SmtpPort: ")
                .append(email.getSmtpPort())
                .append("\n")
                .append("SslSmtpPort: ")
                .append(email.getSslSmtpPort())
                .append("\n")
                .append("SSL: ")
                .append(email.isSSL())
                .append("\n")
                .append("TLS: ")
                .append(email.isTLS())
                .append("\n")
                .append("SSLCheckServerIdentity: ")
                .append(email.isSSLCheckServerIdentity())
                .append("\n")
                .append("SSLOnConnect: ")
                .append(email.isSSLOnConnect())
                .append("\n")
                .append("StartTLSEnabled: ")
                .append(email.isStartTLSEnabled())
                .append("\n")
                .append("StartTLSRequired: ")
                .append(email.isStartTLSRequired())
                .append("\n")
                .append("SubType: ")
                .append(email.getSubType())
                .append("\n")
                .append("SocketConnectionTimeout: ")
                .append(email.getSocketConnectionTimeout())
                .append("\n")
                .append("SocketTimeout: ")
                .append(email.getSocketTimeout())
                .append("\n")
                .append("FromAddress: ")
                .append(email.getFromAddress())
                .append("\n")
                .append("ReplyTo: ")
                .append(email.getReplyToAddresses())
                .append("\n")
                .append("BCC: ")
                .append(email.getBccAddresses())
                .append("\n")
                .append("CC: ")
                .append(email.getCcAddresses())
                .append("\n")
                .append("Subject: ")
                .append(email.getSubject())
                .append("\n")
                .append("Message: ")
                .append(email.toString())
                .append("\n")
                .append("SentDate: ")
                .append(email.getSentDate())
                .append("\n");
        Logger.debug("Password Recovery is ready to send: \n" + logEmail.toString());
      }
      email.send();

    } catch (EmailException authEx) {
      Logger.error("ERROR SENDING MAIL:" + ExceptionUtils.getStackTrace(authEx));
      throw new PasswordRecoveryException(
          errorString
              + " Could not reach the mail server. Please contact the server administrator");
    } catch (Exception e) {
      Logger.error("ERROR SENDING MAIL:" + ExceptionUtils.getStackTrace(e));
      throw new Exception(errorString, e);
    }
  }
Exemplo n.º 5
0
  public static void mailConfirmation(UsuarioSistema user, String uuid) throws EmailException {
    HtmlEmail email = new HtmlEmail();
    email.setHostName("localhost");
    email.setSmtpPort(25);
    email.setAuthentication("*****@*****.**", "");
    email.setSSLOnConnect(false);
    email.setFrom("*****@*****.**", "RedPG");
    email.setSubject("RedPG - Confirmação de e-mail");
    email.addTo(user.getEmail());

    email.setTextMsg(
        "Olá, "
            + user.getName()
            + ".\n\n"
            + "Obrigado por se registrar no sistema!\n\n"
            + "Para começar a utilizar o sistema, é necessário ativar a sua conta.\n"
            + "Você pode fazer isso seguindo o link a seguir:\n"
            + "http://redpg.com.br/index.html?confirm#"
            + uuid
            + "\n\nCaso esse link não funcione para você, acesse: \n"
            + "http://redpg.com.br/service/ActivateAccount.jsp?lingo=pt_br \n"
            + "E digite o código: \n"
            + uuid
            + "\n\nPara ativar sua conta. Você não poderá utilizar sua conta até a ativar por um dos links acima."
            + "\n\n\nObrigado por ter registrado sua conta!");

    email.setHtmlMsg(
        "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
            + "<html>\n"
            + "    <head>\n"
            + "        <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n"
            + "    </head>\n"
            + "    <body style=\"margin: 0px;\">\n"
            + "        <div style=\"width: 100%; height: 100%; display: table\">\n"
            + "            <div style=\"display: table-cell; width: 100%; height: 100%; background-color: #b2b9cf; border: solid 1px #000; text-align: center; vertical-align: middle\">\n"
            + "                <div style='display: block; width: 100%; text-align: center'>\n"
            + "                    <p style='font-size: 3em; margin: 20px; font-variant: small-caps'>RedPG</p>\n"
            + "                </div>\n"
            + "                <div style=\"display:inline-block; width: 80%; height: 300px; margin-bottom: 20px; background-color: white; border: solid 2px black;\">\n"
            + "                    <p>Olá, "
            + user.getName()
            + ".</p>\n"
            + "                    <p>&nbsp;</p>\n"
            + "                    <p>Obrigado por se registrar no sistema!</p>\n"
            + "                    <p>Para começar a utilizar o sistema, é necessário ativar a sua conta.\n"
            + "                    <p>Você pode fazer isso seguindo o link a seguir:</p>\n"
            + "                    <p><a href='http://redpg.com.br/index.html?confirm#"
            + uuid
            + "' target='_blank'>http://redpg.com.br/app/index.html?confirm#"
            + uuid
            + "</a></p>\n"
            + "<p>Caso o link acima não funcione, acesse:</p>"
            + "<p><a href='http://redpg.com.br/service/ActivateAccount.jsp?lingo=pt_br' target='_blank'>http://redpg.com.br/service/ActivateAccount.jsp?lingo=pt_br</a>"
            + "<p>E digite o código:</p>"
            + "<p>"
            + uuid
            + "</p>"
            + "<p>Para ativar sua conta. Você não poderá utilizar sua conta antes de seguir esses passos.</p>"
            + "                    <p style='margin-top: 20px;'>Obrigado por ter registrado sua conta!</p>\n"
            + "                </div>\n"
            + "            </div>\n"
            + "        </div>\n"
            + "    </body>\n"
            + "</html>");

    email.send();
  }