    void sendHtmlMailReport(ITestContext testContext) {
        String buildNumber = System.getProperty("sgtest.buildNumber");
        String suiteName = System.getProperty("sgtest.suiteName");
        List<String> mailRecipients = null;
        if(buildNumber == null)
            return;
        Properties props = new Properties();
        InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("framework/report/mailreporter.properties");
        try {
            props.load(in);
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        MailReporterProperties mailProperties = new MailReporterProperties(props);
        String link = null;
        if (suiteName.contains("webui")) {
        	link = "<a href=http://192.168.9.121:8087/sgtest.webui/" + buildNumber + "/" + suiteName + "/html>"+buildNumber+" </a>";
        }
        else {
        	link = "<a href=http://192.168.9.121:8087/sgtest-cloudify/" + buildNumber + "/" + suiteName + "/html>"+buildNumber+" </a>";
        }
        StringBuilder sb = new StringBuilder();
        sb.append("<html>").append("\n");
        sb.append("<h1>SGTtest Results </h1></br></br></br>").append("\n");
        sb.append("<h2>Suite Name:  " + testContext.getSuite().getName() + " </h2></br>").append("\n");
        sb.append("<h4>Start Date:  " + testContext.getStartDate() + " </h4></br>").append("\n");
        sb.append("<h4>End Date:  " + testContext.getEndDate() + " </h4></br>").append("\n");
        sb.append("<h4 style=\"color:blue\">Skipped Configurations:  " + testContext.getSkippedConfigurations().size() + " </h4></br>").append("\n");
        sb.append("<h4 style=\"color:orange\">Skipped Tests:  " + testContext.getSkippedTests().size() + " </h4></br>").append("\n");
        sb.append("<h4 style=\"color:red\">Failed Tests:  " + testContext.getFailedTests().size() + " </h4></br>").append("\n");
        sb.append("<h4 style=\"color:green\">Passed Tests:  " + testContext.getPassedTests().size() + " </h4></br>").append("\n");
        sb.append("<h4>Full Suite Report:  " + link + " </h4></br>").append("\n");
        sb.append("</html>");
        try {
        	mailRecipients = mailProperties.getRecipients();
        	if (suiteName.contains("webui")) mailRecipients = mailProperties.getWebUIRecipients();
        	if (suiteName.equals("ServiceGrid")) mailRecipients = mailProperties.getSGRecipients();
        	if (suiteName.equals("WAN")) mailRecipients = mailProperties.getWanRecipients();
        	if (suiteName.equals("SECURITY")) mailRecipients = mailProperties.getSecurityRecipients();
        	if (suiteName.equals("CLOUDIFY")) mailRecipients = mailProperties.getCloudifyRecipients();
        	if (suiteName.equals("ESM")) mailRecipients = mailProperties.getESMRecipients();
            SimpleMail.send(mailProperties.getMailHost(), mailProperties.getUsername(), mailProperties.getPassword(),
                    "SGTest Suite " + testContext.getSuite().getName() + " results", sb.toString(), mailRecipients);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    void sendHtmlMailReport(ITestContext testContext) {
        String buildNumber = System.getProperty("sgtest.buildNumber");
        String suiteName = System.getProperty("sgtest.suiteName");
        List<String> mailRecipients = null;
        if(buildNumber == null)
            return;
        Properties props = new Properties();
        InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("framework/report/mailreporter.properties");
        try {
            props.load(in);
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        MailReporterProperties mailProperties = new MailReporterProperties(props);
        String link = null;
        if (suiteName.contains("webui")) {
        	link = "<a href=http://192.168.9.121:8087/sgtest.webui.cloudify/" + buildNumber + "/" + suiteName + "/html>"+buildNumber+" </a>";
        }
        else {
        	link = "<a href=http://192.168.9.121:8087/sgtest-cloudify/" + buildNumber + "/" + suiteName + "/html>"+buildNumber+" </a>";
        }
        StringBuilder sb = new StringBuilder();
        sb.append("<html>").append("\n");
        sb.append("<h1>SGTtest Results </h1></br></br></br>").append("\n");
        sb.append("<h2>Suite Name:  " + testContext.getSuite().getName() + " </h2></br>").append("\n");
        sb.append("<h4>Start Date:  " + testContext.getStartDate() + " </h4></br>").append("\n");
        sb.append("<h4>End Date:  " + testContext.getEndDate() + " </h4></br>").append("\n");
        sb.append("<h4 style=\"color:blue\">Skipped Configurations:  " + testContext.getSkippedConfigurations().size() + " </h4></br>").append("\n");
        sb.append("<h4 style=\"color:orange\">Skipped Tests:  " + testContext.getSkippedTests().size() + " </h4></br>").append("\n");
        sb.append("<h4 style=\"color:red\">Failed Tests:  " + testContext.getFailedTests().size() + " </h4></br>").append("\n");
        sb.append("<h4 style=\"color:green\">Passed Tests:  " + testContext.getPassedTests().size() + " </h4></br>").append("\n");
        sb.append("<h4>Full Suite Report:  " + link + " </h4></br>").append("\n");
        sb.append("</html>");
        try {
        	mailRecipients = mailProperties.getRecipients();
        	if (suiteName.contains("webui")) mailRecipients = mailProperties.getWebUIRecipients();
        	if (suiteName.equals("ServiceGrid")) mailRecipients = mailProperties.getSGRecipients();
        	if (suiteName.equals("WAN")) mailRecipients = mailProperties.getWanRecipients();
        	if (suiteName.equals("SECURITY")) mailRecipients = mailProperties.getSecurityRecipients();
        	if (suiteName.equals("CLOUDIFY")) mailRecipients = mailProperties.getCloudifyRecipients();
        	if (suiteName.equals("ESM")) mailRecipients = mailProperties.getESMRecipients();
            SimpleMail.send(mailProperties.getMailHost(), mailProperties.getUsername(), mailProperties.getPassword(),
                    "SGTest Suite " + testContext.getSuite().getName() + " results", sb.toString(), mailRecipients);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
