Package org.apache.commons.mail

Examples of org.apache.commons.mail.EmailException


     for definitions
     *
     */
    public HtmlEmailImpl setHtmlMsg(String aHtml) throws EmailException {
        if (StringUtil.isEmpty(aHtml)) {
            throw new EmailException("Invalid message supplied");
        }
        this.html = aHtml;
        return this;
    }
View Full Code Here


     for definitions
     *
     */
    public Email setMsg(String msg) throws EmailException {
        if (StringUtil.isEmpty(msg)) {
            throw new EmailException("Invalid message supplied");
        }

        setTextMsg(msg);

        setHtmlMsg(
View Full Code Here

        try {
            InputStream is = url.openStream();
            is.close();
        }
        catch (IOException e) {
            throw new EmailException("Invalid URL");
        }

        MimeBodyPart mbp = new MimeBodyPart();

        try {
            mbp.setDataHandler(new DataHandler(new URLDataSource(url)));
            mbp.setFileName(name);
            mbp.setDisposition("inline");
            mbp.addHeader("Content-ID", "<" + cid + ">");
            this.inlineImages.add(mbp);
        }
        catch (MessagingException me) {
            throw new EmailException(me);
        }
    }
View Full Code Here

            }

        }
        catch (MessagingException me)
        {
            throw new EmailException(me);
        }
        super.buildMimeMessage();
    }
View Full Code Here

      try {
        client.sendRawEmail(new SendRawEmailRequest()
            .withRawMessage(mail2Content(email)));
      } catch (Exception e) {
        throw new EmailException(e);
      }
    } else {
      new MockMailer().send(email);
    }
  }
View Full Code Here

    String queryString = "";
    if(req.getMethod().equals("GET")){
      queryString = (String) req.getAttribute(REQUEST_PARAMETERS);
    }
    if(!env.has(TARGET_MAILING_LIST)) {
      throw new EmailException(noMailingListMessage());
    }
    String mailingList = env.get(TARGET_MAILING_LIST);
    String from = env.get(SIMPLE_MAIL_FROM);
    String fromName = env.get(SIMPLE_MAIL_FROM_NAME);
    String subject = getSubject();
View Full Code Here

      try {
        client.sendRawEmail(new SendRawEmailRequest()
            .withRawMessage(mail2Content(email)));
      } catch (Exception e) {
        throw new EmailException(e);
      }
    } else {
      new MockMailer().send(email);
    }
  }
View Full Code Here

      try {
        client.sendRawEmail(new SendRawEmailRequest()
            .withRawMessage(mail2Content(email)));
      } catch (Exception e) {
        throw new EmailException(e);
      }
    } else {
      new MockMailer().send(email);
    }
  }
View Full Code Here

    String queryString = "";
    if (req.getMethod().equals("GET")){
      queryString = (String) req.getAttribute(REQUEST_PARAMETERS);
    }
    if (!env.has(TARGET_MAILING_LIST)) {
      throw new EmailException(noMailingListMessage());
    }
    String mailingList = env.get(TARGET_MAILING_LIST);
    String from = env.get(SIMPLE_MAIL_FROM);
    String fromName = env.get(SIMPLE_MAIL_FROM_NAME);
    String headers = getHeaders();
View Full Code Here

      try {
        client.sendRawEmail(new SendRawEmailRequest()
            .withRawMessage(mail2Content(email)));
      } catch (Exception e) {
        throw new EmailException(e);
      }
    } else {
      new MockMailer().send(email);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.mail.EmailException

Copyright © 2018 www.massapicom. 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.