email.setStartTLSEnabled(starttlsEnabled); if (starttlsEnabled) { email.setSslSmtpPort(port);
ifset("ssl.onConnect", p -> email.setSSLOnConnect(mail.getBoolean(p))); ifset("ssl.smtpPort", p -> email.setSslSmtpPort(mail.getString(p))); ifset("startTLSEnabled", p -> email.setStartTLSEnabled(mail.getBoolean(p))); ifset("startTLSRequired", p -> email.setStartTLSRequired(mail.getBoolean(p))); ifset("subject", p -> email.setSubject(mail.getString(p)));
email.setStartTLSEnabled(configuration.isUseTls()); if (pluginConfig != null && !isNullOrEmpty(pluginConfig.getString("sender"))) { email.setFrom(pluginConfig.getString("sender"));
/** * Set or disable the STARTTLS encryption. Please see EMAIL-105 * for the reasons of deprecation. * * @deprecated since 1.3, use setStartTLSEnabled() instead * @param withTLS true if STARTTLS requested, false otherwise * @since 1.1 */ @Deprecated public void setTLS(final boolean withTLS) { setStartTLSEnabled(withTLS); }
email.setStartTLSEnabled(mailServerInfo.isMailServerUseTLS()); email.setStartTLSEnabled(processEngineConfiguration.getMailServerUseTLS());
private static void configEmail(String subject, Email email, String... recipients) throws EmailException { if (recipients == null) throw new EmailException("Recipients not found."); Mail mail = MailPlugin.getMail(); email.setCharset(mail.getCharset()); email.setSocketTimeout(mail.getTimeout()); email.setSocketConnectionTimeout(mail.getConnectout()); email.setHostName(mail.getHost()); if (!mail.getSslport().isEmpty()) email.setSslSmtpPort(mail.getSslport()); if (!mail.getPort().isEmpty()) email.setSmtpPort(Integer.parseInt(mail.getPort())); email.setSSLOnConnect(mail.isSsl()); email.setStartTLSEnabled(mail.isTls()); email.setDebug(mail.isDebug()); email.setAuthentication(mail.getUser(), mail.getPassword()); email.setFrom(mail.getFrom(), mail.getName()); email.setSubject(subject); email.addTo(recipients); }
/** * Set or disable the STARTTLS encryption. Please see EMAIL-105 * for the reasons of deprecation. * * @deprecated since 1.3, use setStartTLSEnabled() instead * @param withTLS true if STARTTLS requested, false otherwise * @since 1.1 */ @Deprecated public void setTLS(final boolean withTLS) { setStartTLSEnabled(withTLS); }
private void initEmail(Email email,String fromEmail, String fromPasswd,String fromName, String host,List<String> toEmailList,MailMsg mailMsg) throws EmailException{ email.setHostName(host); //邮件服务器验证:用户名/密码 email.setAuthentication(fromEmail, fromPasswd); //必须放在前面,否则乱码 email.setCharset(MailCfg.CHARSET); email.setDebug(false);//是否开启调试默认不开启 email.setSSLOnConnect(true);//开启SSL加密 email.setStartTLSEnabled(true);//开启TLS加密 email.addTo(toEmailList.toArray(new String[0])); email.setFrom(fromEmail,fromName); email.setSubject(mailMsg.getSubject()); } }
public void sendEmail(final Email email) throws EmailException { email.setHostName(hostname); if (ssl != null) email.setSSLOnConnect(ssl); if (start_tls_enabled != null) email.setStartTLSEnabled(start_tls_enabled); if (start_tls_required != null) email.setStartTLSRequired(start_tls_required); if (port != null) email.setSmtpPort(port); if (username != null) email.setAuthentication(username, password); if (connection_timeout != null) email.setSocketConnectionTimeout(connection_timeout); if (timeout != null) email.setSocketTimeout(timeout); 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();
mail.setStartTLSEnabled(configuration.isStartTlsEnabled()); mail.setStartTLSRequired(configuration.isStartTlsRequired()); mail.setSSLOnConnect(configuration.isSslOnConnectEnabled());
ifset("ssl.onConnect", p -> email.setSSLOnConnect(mail.getBoolean(p))); ifset("ssl.smtpPort", p -> email.setSslSmtpPort(mail.getString(p))); ifset("startTLSEnabled", p -> email.setStartTLSEnabled(mail.getBoolean(p))); ifset("startTLSRequired", p -> email.setStartTLSRequired(mail.getBoolean(p))); ifset("subject", p -> email.setSubject(mail.getString(p)));
mail.setSSLOnConnect(true); } else if (SECURITY_STARTTLS.equalsIgnoreCase(security)) { mail.setStartTLSEnabled(true);
Email email = new SimpleEmail(); email.setHostName("smtp.office365.com"); email.setSmtpPort(587); email.setAuthenticator(new DefaultAuthenticator("a@b.com", "****")); email.setStartTLSEnabled(true); try { email.setFrom("a@b.com"); email.setSubject("Job Failure"); email.setDebug(true); email.setMsg("This is a test mail ... :-)" ); email.addTo("a@y.com"); email.send(); } catch (EmailException e) { e.printStackTrace(); }
protected void sendEmail(Email email) throws EmailException { email.setHostName(config.getHostName()); email.setSmtpPort(config.getPort()); email.setStartTLSEnabled(config.isTLS()); if (Strings.hasText(config.getUsername())) { email.setAuthentication(config.getUsername(), config.getPassword()); } if (config.isSSL()) { email.setSSLOnConnect(config.isSSL()); email.setSslSmtpPort(Integer.toString(config.getPort())); email.setSSLCheckServerIdentity(config.isSSLCheckServerIdentity()); } email.send(); }
protected void sendEmail(Email email) throws EmailException { email.setHostName(config.getHostName()); email.setSmtpPort(config.getPort()); email.setStartTLSEnabled(config.isTLS()); if (Strings.hasText(config.getUsername())) { email.setAuthentication(config.getUsername(), config.getPassword()); } if (config.isSSL()) { email.setSSLOnConnect(config.isSSL()); email.setSslSmtpPort(Integer.toString(config.getPort())); email.setSSLCheckServerIdentity(config.isSSLCheckServerIdentity()); } email.send(); }
email.setStartTLSEnabled(configuration.isUseTls()); if (pluginConfig != null && !isNullOrEmpty(pluginConfig.getString("sender"))) { email.setFrom(pluginConfig.getString("sender"));
email.setStartTLSEnabled(mailServerInfo.isMailServerUseTLS()); email.setStartTLSEnabled(processEngineConfiguration.getMailServerUseTLS());
email.setStartTLSEnabled(mailServerInfo.isMailServerUseTLS()); email.setStartTLSEnabled(processEngineConfiguration.getMailServerUseTLS());
/** * Factory method to create a pre-configured email instance. * * @param clazz the requested implementation class * @return the new instance * @throws Exception creating the Email instance failed */ private Email create(final Class<? extends Email> clazz) throws Exception { final Email email = clazz.newInstance(); email.setStartTLSEnabled(EmailConfiguration.MAIL_USE_STARTTLS); email.setStartTLSRequired(EmailConfiguration.MAIL_STARTTLS_REQUIRED); email.setSSLOnConnect(EmailConfiguration.MAIL_USE_SSL); email.setSSLCheckServerIdentity(EmailConfiguration.MAIL_SSL_CHECKSERVERIDENTITY); email.setHostName(EmailConfiguration.MAIL_SERVER); email.setSmtpPort(EmailConfiguration.MAIL_SERVER_PORT); email.setBounceAddress(EmailConfiguration.TEST_FROM); email.setDebug(EmailConfiguration.MAIL_DEBUG); email.setCharset(EmailConfiguration.MAIL_CHARSET); email.setFrom(EmailConfiguration.TEST_FROM); email.addTo(EmailConfiguration.TEST_TO); if(EmailConfiguration.TEST_USER != null) { email.setAuthenticator(new DefaultAuthenticator(EmailConfiguration.TEST_USER, EmailConfiguration.TEST_PASSWD)); } return email; }