Examples of SimpleEmail


Examples of org.apache.turbine.util.mail.SimpleEmail

            DynamicURI url = new DynamicURI(rundata);

            //build body via template
            StringWriter email_body = new StringWriter();
            SimpleEmail se = new SimpleEmail();
            Context emailContext = TurbineVelocity.getContext();
            emailContext.put( "data", rundata );
            emailContext.put( "user", user );
            emailContext.put( "config",new JetspeedResources());
            emailContext.put( "urltojetspeed",url);
            emailContext.put( "email",se);

            //determine the language to be used for the notification email
            String language = (String)user.getPerm("language",TurbineResources.getString("locale.default.language", "en"));
            String country = (String)user.getPerm("country",TurbineResources.getString("locale.default.country", "US"));
            Locale locale = new Locale(language,country);

            String templateFile = JetspeedResources.getString("newuser.approval.reject.template");
            String templatePath = TemplateLocator.locateEmailTemplate(rundata, templateFile, locale );
            TurbineVelocity.handleRequest(emailContext, templatePath, email_body);

            se.setMsg( email_body.toString() );

            Properties props = System.getProperties();
            String mailServerMachine = JetspeedResources.getString( "mail.server" );
            props.put ( "mail.host", mailServerMachine );
            props.put("mail.smtp.host", mailServerMachine);

            se.send();

        } catch (Exception e)
        {
            // log the error msg
              Log.error(e);
View Full Code Here

Examples of org.apache.turbine.util.mail.SimpleEmail

            DynamicURI url = new DynamicURI(rundata);

            //build body via template
            StringWriter email_body = new StringWriter();
            SimpleEmail se = new SimpleEmail();
            Context emailContext = TurbineVelocity.getContext();
            emailContext.put( "data", rundata );
            emailContext.put( "user", user );
            emailContext.put( "config",new JetspeedResources());
            emailContext.put( "urltojetspeed",url);
            emailContext.put( "email",se);

            //determine the language to be used for the notification email
            String language = (String)user.getPerm("language",TurbineResources.getString("locale.default.language", "en"));
            String country = (String)user.getPerm("country",TurbineResources.getString("locale.default.country", "US"));
            Locale locale = new Locale(language,country);

            String templateFile = JetspeedResources.getString("newuser.approval.accept.template");
            String templatePath = TemplateLocator.locateEmailTemplate(rundata, templateFile, locale );
            TurbineVelocity.handleRequest(emailContext, templatePath, email_body);

            se.setMsg( email_body.toString() );

            Properties props = System.getProperties();
            String mailServerMachine = JetspeedResources.getString( "mail.server" );
            props.put ( "mail.host", mailServerMachine );
            props.put("mail.smtp.host", mailServerMachine);

            se.send();


        } catch (Exception e)
        {
            // log the error msg
View Full Code Here

Examples of org.apache.turbine.util.mail.SimpleEmail

            DynamicURI url = new DynamicURI(rundata);

            //build body via template
            StringWriter email_body = new StringWriter();
            SimpleEmail se = new SimpleEmail();
            Context emailContext = TurbineVelocity.getContext();
            emailContext.put( "data", rundata );
            emailContext.put( "user", user );
            emailContext.put( "config",new JetspeedResources());
            emailContext.put( "urltojetspeed",url);
            emailContext.put( "email",se);

            //determine the language to be used for the notification email
            String language = (String)user.getPerm("language",TurbineResources.getString("locale.default.language", "en"));
            String country = (String)user.getPerm("country",TurbineResources.getString("locale.default.country", "US"));
            Locale locale = new Locale(language,country);

            String templateFile = JetspeedResources.getString("newuser.approval.reject.template");
            String templatePath = TemplateLocator.locateEmailTemplate(rundata, templateFile, locale );
            TurbineVelocity.handleRequest(emailContext, templatePath, email_body);

            se.setMsg( email_body.toString() );

            Properties props = System.getProperties();
            String mailServerMachine = JetspeedResources.getString( "mail.server" );
            props.put ( "mail.host", mailServerMachine );
            props.put("mail.smtp.host", mailServerMachine);

            se.send();

        } catch (Exception e)
        {
            // log the error msg
              logger.error("Exception", e);
View Full Code Here

Examples of org.apache.turbine.util.mail.SimpleEmail

        try
        {
            // Process the template.
            String body = TurbineWebMacro.handleRequest(context,template);

            SimpleEmail se = new SimpleEmail();
            se.setFrom(fromEmail, fromName);
            se.addTo(toEmail, toName);
            se.setSubject(subject);
            se.setMsg(body);
            se.send();
        }
        catch (Exception e)
        {
            // Log the error.
            Log.error ("WebMacroEmail error: ", e);
View Full Code Here

Examples of org.apache.turbine.util.mail.SimpleEmail

            body = StringUtils.wrapText (body,
                                         System.getProperty("line.separator"),
                                         wordWrap);
        }

        SimpleEmail se = new SimpleEmail();
        se.setFrom(fromEmail, fromName);
        se.addTo(toEmail, toName);
        se.setSubject(subject);
        se.setMsg(body);
        se.send();
    }
View Full Code Here

Examples of org.apache.turbine.util.mail.SimpleEmail

            body = StringUtils.wrapText (body,
                                         System.getProperty("line.separator"),
                                         wordWrap);
        }

        SimpleEmail se = new SimpleEmail();
        se.setFrom(fromEmail, fromName);
        se.addTo(toEmail, toName);
        se.setSubject(subject);
        se.setMsg(body);
        se.send();
    }
View Full Code Here

Examples of org.apache.turbine.util.mail.SimpleEmail

        try
        {
            // Process the template.
            String body = TurbineWebMacro.handleRequest(context,template);

            SimpleEmail se = new SimpleEmail();
            se.setFrom(fromEmail, fromName);
            se.addTo(toEmail, toName);
            se.setSubject(subject);
            se.setMsg(body);
            se.send();
        }
        catch (Exception e)
        {
            // Log the error.
            Log.error ("WebMacroEmail error: ", e);
View Full Code Here

Examples of org.apache.turbine.util.mail.SimpleEmail

            body = StringUtils.wrapText (body,
                                         System.getProperty("line.separator"),
                                         wordWrap);
        }

        SimpleEmail se = new SimpleEmail();
        se.setFrom(fromEmail, fromName);
        se.addTo(toEmail, toName);
        se.setSubject(subject);
        se.setMsg(body);
        se.send();
    }
View Full Code Here

Examples of org.apache.turbine.util.mail.SimpleEmail

        try
        {
            // Process the template.
            String body = TurbineWebMacro.handleRequest(context,template);

            SimpleEmail se = new SimpleEmail();
            se.setFrom(fromEmail, fromName);
            se.addTo(toEmail, toName);
            se.setSubject(subject);
            se.setMsg(body);
            se.send();
        }
        catch (Exception e)
        {
            // Log the error.
            Log.error ("WebMacroEmail error: ", e);
View Full Code Here

Examples of pt.opensoft.mail.SimpleEmail

    this.mailsTo = mailsTo;
    this.sendMailWhenException = true;
  }

  private void warnExceptionByEmail(Throwable e) {
      SimpleEmail email = new SimpleEmail(this.mailSmtp);
      try {
            email.setFrom(this.mailFrom, getNameProcess());
        for (int i = 0; i < this.mailsTo.size(); i++) {
          email.addTo((String)mailsTo.get(i));
        }
        email.setSubject(getNameProcess() + " Exception: " + e.getMessage());
        StringBuffer message = new StringBuffer();
        message.append("Foi lan�ada uma excep��o pelo Processo ").append(getNameProcess()).append(" causando o fim da sua execu��o � seguinte data: ").append(new DateTime(new java.util.Date()).formatDateTime());
        message.append("\n\nStack Trace:\n");
        message.append("\t").append(StringUtil.toString(e));
            email.setMsg(message.toString());
            email.send();
        } catch (Exception mailException) {
            logger.warning("Error sending exception mail: " + mailException);
        }
  }
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.