@Override public SimpleEmail get() { return factory.newEmail(new SimpleEmail()); }
protected SimpleEmail createTextOnlyEmail(String text) { SimpleEmail email = new SimpleEmail(); try { email.setMsg(text); return email; } catch (EmailException e) { throw new ActivitiException("Could not create text-only email", e); } }
/** * @param subject 主题 * @param body 内容 * @param recipients 收件人 */ public static SimpleEmail getSimpleEmail(String subject, String body, String... recipients) throws EmailException { SimpleEmail simpleEmail = new SimpleEmail(); configEmail(subject, simpleEmail, recipients); if (body != null) simpleEmail.setMsg(body); return simpleEmail; }
SimpleEmail email = new SimpleEmail(); if (StringUtils.isNotBlank(host)) {
Email email = new SimpleEmail(); email.setHostName(state.getProp(ConfigurationKeys.EMAIL_HOST_KEY, ConfigurationKeys.DEFAULT_EMAIL_HOST)); if (state.contains(ConfigurationKeys.EMAIL_SMTP_PORT_KEY)) {
final Email email = new SimpleEmail(); email.setCharset(EmailConstants.UTF_8);
protected SimpleEmail createTextOnlyEmail(String text) { SimpleEmail email = new SimpleEmail(); try { email.setMsg(text); return email; } catch (EmailException e) { throw LOG.emailCreationException("text-only", e); } }
protected SimpleEmail createTextOnlyEmail(String text) { SimpleEmail email = new SimpleEmail(); try { email.setMsg(text); return email; } catch (EmailException e) { throw LOG.emailCreationException("text-only", e); } }
public void sendTextEmail(String targetAddress,String title,String content) throws Exception { Email email = new SimpleEmail(); email.setMsg(content); email.setSubject(title); email.addTo(targetAddress); sendEmail(email); }
SimpleEmail email = new SimpleEmail(); email.setHostName("mail.myserver.com"); email.addTo("jdoe@somewhere.org", "John Doe"); email.setFrom("me@apache.org", "Me"); email.setSubject("Test message"); email.setMsg("This is a simple test of commons-email"); email.send();
Email email = new SimpleEmail(); String authuser = "...@gmail.com"; String authpwd = "xxxx"; email.setSmtpPort(587); email.setAuthenticator(new DefaultAuthenticator(authuser, authpwd)); email.setDebug(true); email.setHostName("smtp.gmail.com"); email.getMailSession().getProperties().put("mail.smtps.auth", "true"); email.getMailSession().getProperties().put("mail.debug", "true"); email.getMailSession().getProperties().put("mail.smtps.port", "587"); email.getMailSession().getProperties().put("mail.smtps.socketFactory.port", "587"); email.getMailSession().getProperties().put("mail.smtps.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); email.getMailSession().getProperties().put("mail.smtps.socketFactory.fallback", "false"); email.getMailSession().getProperties().put("mail.smtp.starttls.enable", "true"); email.setFrom("........@gmail.com", "SenderName"); email.setSubject("TestMail"); email.setMsg("This is a test mail?"); email.addTo("xxxx@gmail.com", "ToName"); email.setTLS(true); email.send();
protected SimpleEmail createTextOnlyEmail(String text) { SimpleEmail email = new SimpleEmail(); try { email.setMsg(text); return email; } catch (EmailException e) { throw new ActivitiException("Could not create text-only email", e); } }
protected SimpleEmail createTextOnlyEmail(String text) { SimpleEmail email = new SimpleEmail(); try { email.setMsg(text); return email; } catch (EmailException e) { throw new FlowableException("Could not create text-only email", e); } }
@Override public void sendVerification(final EmailConfiguration configuration, final String address) throws EmailException { checkNotNull(configuration); checkNotNull(address); Email mail = new SimpleEmail(); mail.setSubject("Email configuration verification"); mail.addTo(address); mail.setMsg("Verification successful"); mail = apply(configuration, mail); mail.send(); }
public void sendSimpleEmail(String toEmail, String toName, String subject, String msg) throws Exception { try { SimpleEmail email = new SimpleEmail(); this.setEmail(email, toEmail, toName, subject, msg, null, null); email.send(); } catch (EmailException e) { e.printStackTrace(); throw e; } }
public void sendSimpleEmails(Map toEmails, String subject, String msg) throws Exception { try { SimpleEmail email = new SimpleEmail(); this.setEmail(email, toEmails, subject, msg); email.send(); } catch (EmailException e) { e.printStackTrace(); throw e; } }
SimpleEmail email = new SimpleEmail(); email.setHostName("mail.myserver.com"); email.addTo("jdoe@somewhere.org", "John Doe"); email.setFrom("me@apache.org", "Me"); email.setSubject("Test message"); email.setMsg("This is a simple test of commons-email"); email.send();
Email email = new SimpleEmail(); email.setHostName("smtp.gmail.com"); email.setSmtpPort(465); email.setAuthenticator(new DefaultAuthenticator("username", "password")); email.setSSLOnConnect(true); email.setFrom("user@gmail.com"); email.setSubject("TestMail"); email.setMsg("This is a test mail ... :-)"); email.addTo("foo@bar.com"); email.send();
Email email = new SimpleEmail(); email.setHostName("smtp.gmail.com"); email.setSmtpPort(587); email.setAuthenticator(new DefaultAuthenticator("username", "password")); email.setStartTLSEnabled(true); email.setFrom("user@gmail.com"); email.setSubject("TestMail"); email.setMsg("This is a test mail ... :-)"); email.addTo("foo@bar.com"); email.send();
Email email = new SimpleEmail(); email.setHostName("smtp.googlemail.com"); email.setSmtpPort(465); email.setAuthenticator(new DefaultAuthenticator("username", "password")); email.setSSLOnConnect(true); email.setFrom("user@gmail.com"); email.setSubject("TestMail"); email.setMsg("This is a test mail ... :-)"); email.addTo("foo@bar.com"); email.send();