Examples of MailServerException


Examples of net.naijatek.myalumni.framework.exceptions.MailServerException

            new FreeMarkerTemplateMailerImpl(mailSender, configuration).mail(recipient, map, bodyTemplatePrefix, subjectTemplatePrefix);
        }
        catch (Exception e) {
            e.printStackTrace();
            logger.error("sendProfileChangeNotificationMail: " + e.getMessage());
            throw new MailServerException("Error encountered when sending email to remind user of password " + e.getCause().toString());
        }       
    }
View Full Code Here

Examples of net.naijatek.myalumni.framework.exceptions.MailServerException

          new FreeMarkerTemplateMailerImpl(mailSender, configuration).mail(email, map, bodyTemplatePrefix, subjectTemplatePrefix);
      }
      catch (Exception e) {
          e.printStackTrace();
          logger.error("sendWelcomeNotice: " + e.getMessage());
          throw new MailServerException("Error encountered sendWelcomeNotice " + e.getCause().toString());
     
    }
View Full Code Here

Examples of net.naijatek.myalumni.framework.exceptions.MailServerException

            new FreeMarkerTemplateMailerImpl(mailSender, configuration).mail(memberVO.getEmail(), map, bodyTemplatePrefix, subjectTemplatePrefix);
        }
        catch (Exception e) {
            e.printStackTrace();
            logger.error("sendBirthdayWish: " + e.getMessage());
            throw new MailServerException("Error encountered sendBirthdayWish " + e.getCause().toString());
        }
      }
View Full Code Here

Examples of net.naijatek.myalumni.framework.exceptions.MailServerException

            new FreeMarkerTemplateMailerImpl(mailSender, configuration).mail(email, map, bodyTemplatePrefix, subjectTemplatePrefix);
        }
        catch (Exception e) {
            e.printStackTrace();
            logger.error("sendPasswordReminderMail: " + e.getMessage());
            throw new MailServerException("Error encountered sendPasswordReminderMail " + e.getCause().toString());
        }
       
    }
View Full Code Here

Examples of net.naijatek.myalumni.framework.exceptions.MailServerException

            new FreeMarkerTemplateMailerImpl(mailSender, configuration).mail(email, map, bodyTemplatePrefix, subjectTemplatePrefix);
        }
        catch (Exception e) {
            e.printStackTrace();
            logger.error("sendPasswordReminderMail: " + e.getMessage());
            throw new MailServerException("Error encountered sendPasswordReminderMail " + e.getCause().toString());
        }
       
    }
View Full Code Here

Examples of net.naijatek.myalumni.framework.exceptions.MailServerException

            new FreeMarkerTemplateMailerImpl(mailSender, configuration).mail(sysConfigVO.getOrgEmail(), map, bodyTemplatePrefix, subjectTemplatePrefix);
        }
        catch (Exception e) {
            e.printStackTrace();
            logger.error("notifyAdminAboutNewMember: " + e.getMessage());
            throw new MailServerException("Error encountered sendPasswordReminderMail " + e.getCause().toString());
        }
       
    }
View Full Code Here

Examples of net.naijatek.myalumni.framework.exceptions.MailServerException

        new FreeMarkerTemplateMailerImpl(mailSender, configuration).mail(pm.getGuestEmail(), map, bodyTemplatePrefix, subjectTemplatePrefix);
      }
      catch (Exception ex) {
          ex.printStackTrace();
          logger.error("sendEmail: " + ex.getMessage());
          throw new MailServerException("Error encountered when sending sendEmail " + ex.getCause().toString());
      }
   }
View Full Code Here

Examples of net.naijatek.myalumni.framework.exceptions.MailServerException

        new FreeMarkerTemplateMailerImpl(mailSender, configuration).mail(toEmail, map, bodyTemplatePrefix, subjectTemplatePrefix);
      }
      catch (Exception ex) {
          ex.printStackTrace();
          logger.error("memberNewMessageNotification: " + ex.getMessage());
          throw new MailServerException("Error encountered when sending memberNewMessageNotification " + ex.getCause().toString());
      }

  }
View Full Code Here

Examples of net.naijatek.myalumni.framework.exceptions.MailServerException

            new FreeMarkerTemplateMailerImpl(mailSender, configuration).mail(toEmail, map, bodyTemplatePrefix, subjectTemplatePrefix);
          }
          catch (Exception ex) {
              ex.printStackTrace();
              logger.error("adminNewMessageNotification: " + ex.getMessage());
              throw new MailServerException("Error encountered when sending adminNewMessageNotification " + ex.getCause().toString());
          }
   
    }
View Full Code Here

Examples of net.naijatek.myalumni.framework.exceptions.MailServerException

        this.configuration = freeMarkerConfigurer.getConfiguration();
    }
   
    private static void checkGoodEmail(final String input) throws MailServerException {
        if (input == null) {
      throw new MailServerException("Sorry, null string is not a good email.");
    }
        int atIndex = input.indexOf('@');
        int dotIndex = input.lastIndexOf('.');
        if (atIndex == -1 || dotIndex == -1 || atIndex >= dotIndex) {
      throw new MailServerException("Error: '" + input + "' is not a valid email value. Please try again.");
    }
        // now check for content of the string
        byte[] s = input.getBytes();
        int length = s.length;
        byte b = 0;

        for (int i = 0; i < length; i++) {
            b = s[i];
            if (b >= 'a' && b <= 'z') {
                // lower char
            } else if (b >= 'A' && b <= 'Z') {
                // upper char
            } else if (b >= '0' && b <= '9' && i != 0) {
                // numeric char
            } else if ( ( b=='_' || b=='-' || b=='.' || b=='@' ) && i != 0 ) {
                // _ char
            } else {
                // not good char, throw an BadInputException
                throw new MailServerException(input + " is not a valid email. Reason: character '" + (char)b + "' is not accepted in an email.");
            }
        }// for

        // last check
        try {
            new javax.mail.internet.InternetAddress(input);
        }
        catch (Exception ex) {
                   logger.error("Error when running checkGoodEmail", ex);
                   throw new MailServerException("Assertion: dont want to occur in Util.checkGoodEmail");
               }       
       
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.