String fromHostLine = String.format("This email was sent from host: %s%n%n", hostName); email.setMsg(fromHostLine + message); email.send();
((HtmlEmail) email).setTextMsg(content); email.send(); email.getMailSession();
email.addTo(emailAddress); email.send();
attach(email, files, dataSources); email.send();
email.setCharset("UTF-8"); ((HtmlEmail) email).setHtmlMsg(content); email.send(); email.getMailSession();
public void sendEmail(Email email) throws Exception { email.setAuthentication(username, password); email.setCharset(DEFAULT_CHARSET); email.setFrom(fromAddress); email.setSSLOnConnect(sslOn); email.setHostName(hostName); email.setSmtpPort(smtpPort); 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();
public void execute(ActivityExecution execution) { String toStr = getStringFromField(to, execution); String fromStr = getStringFromField(from, execution); String ccStr = getStringFromField(cc, execution); String bccStr = getStringFromField(bcc, execution); String subjectStr = getStringFromField(subject, execution); String textStr = getStringFromField(text, execution); String htmlStr = getStringFromField(html, execution); String charSetStr = getStringFromField(charset, execution); Email email = createEmail(textStr, htmlStr); addTo(email, toStr); setFrom(email, fromStr); addCc(email, ccStr); addBcc(email, bccStr); setSubject(email, subjectStr); setMailServerProperties(email); setCharset(email, charSetStr); try { email.send(); } catch (EmailException e) { throw LOG.sendingEmailException(toStr, e); } leave(execution); }
public void execute(ActivityExecution execution) { String toStr = getStringFromField(to, execution); String fromStr = getStringFromField(from, execution); String ccStr = getStringFromField(cc, execution); String bccStr = getStringFromField(bcc, execution); String subjectStr = getStringFromField(subject, execution); String textStr = getStringFromField(text, execution); String htmlStr = getStringFromField(html, execution); String charSetStr = getStringFromField(charset, execution); Email email = createEmail(textStr, htmlStr); addTo(email, toStr); setFrom(email, fromStr); addCc(email, ccStr); addBcc(email, bccStr); setSubject(email, subjectStr); setMailServerProperties(email); setCharset(email, charSetStr); try { email.send(); } catch (EmailException e) { throw LOG.sendingEmailException(toStr, e); } leave(execution); }
@Override public void send(final Email mail) throws EmailException { checkNotNull(mail); EmailConfiguration model = getConfigurationInternal(); if (model.isEnabled()) { Email prepared = apply(model, mail); prepared.send(); } else { log.warn("No email enabled but asked to send anyway."); } }
/** * @see java.lang.Thread#run() */ @Override public void run() { try { m_email.send(); } catch (EmailException e) { if (LOG.isErrorEnabled()) { LOG.error(Messages.get().getBundle().key(Messages.LOG_SEND_MAIL_ERR_0), 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 send(Email mail) throws EmailException { mail.setHostName(hostName); mail.setAuthenticator(auth); mail.setSSLOnConnect(sSLOnConnect); //how to handle this properly mail.setSslSmtpPort(String.valueOf(smtpPort)); mail.setSmtpPort(smtpPort); mail.send(); } }
protected void wrapUpAndSend(Email email) throws EmailException { LOGGER.debug(String.format(emailLogTemplate(), email.getSubject(), email.getFromAddress(), email.getToAddresses(), email.getHostName(), email.getSmtpPort(), email.isTLS())); email.send(); }
private void sendNotificationEmail(List<EntityX> items) throws EmailException { Email email = new SimpleEmail(); email.setSubject("Notification about processing of ..."); email.addTo(data.getCustomerEmail()); // Other e-mail parameters, such as the host name of the mail server, have defaults defined through external // configuration. String message = buildNotificationMessage(items); email.setMsg(message); 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();
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();
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();