本文整理了Java中org.apache.commons.mail.HtmlEmail.setDebug()
方法的一些代码示例,展示了HtmlEmail.setDebug()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HtmlEmail.setDebug()
方法的具体详情如下:
包路径:org.apache.commons.mail.HtmlEmail
类名称:HtmlEmail
方法名:setDebug
暂无
代码示例来源:origin: stackoverflow.com
HtmlEmail email = new HtmlEmail();
email.setHostName(mailserver);
email.setAuthentication(username, password);
email.setSmtpPort(port);
email.setFrom(fromEmail);
email.addTo(to);
email.setSubject(subject);
email.setTextMsg(textBody);
email.setHtmlMsg(htmlBody);
email.setDebug(true);
email.send();
代码示例来源:origin: si.urbas/pless
ApacheCommonsEmail(String hostname, int smtpPort, boolean useSsl, boolean useTls, String user, String password, HtmlEmail wrappedEmail) {
this.wrappedEmail = wrappedEmail;
this.wrappedEmail.setHostName(hostname);
this.wrappedEmail.setSmtpPort(smtpPort);
this.wrappedEmail.setSSLOnConnect(useSsl);
this.wrappedEmail.setStartTLSEnabled(useTls);
if (!isNullOrEmpty(user) && !isNullOrEmpty(password)) {
this.wrappedEmail.setAuthentication(user, password);
}
this.wrappedEmail.setDebug(false);
}
代码示例来源:origin: com.bbossgroups.pdp/pdp-cms
email.setHostName(hostName);
email.setSmtpPort(Integer.parseInt(smtpPort));
email.setDebug(true);
Iterator it = toEmails.keySet().iterator();
while (it.hasNext()) {
代码示例来源:origin: stackoverflow.com
HtmlEmail htmlEmail = new HtmlEmail();
htmlEmail.setHostName("smtp.gmail.com");
htmlEmail.setSmtpPort(587);
htmlEmail.setDebug(true);
htmlEmail.setAuthenticator(new DefaultAuthenticator("userId", "password"));
htmlEmail.setTLS(true);
htmlEmail.addTo("recipient@gmail.com", "recipient");
htmlEmail.setFrom("sender@gmail.com", "sender");
htmlEmail.setSubject("Send HTML email with body content from URI");
htmlEmail.setHtmlMsg(responseBody);
htmlEmail.send();
代码示例来源:origin: com.bbossgroups.pdp/pdp-cms
public void sendHtmlEmail(String toEmail, String toName, String subject, String htmlMsg, String senderMail, String senderName, String mail_userName, String mail_password, String smtpPort) throws Exception {
try {
HtmlEmail email = new HtmlEmail();
MailServerInfo msi = (MailServerInfo)serverinfos.get(this.getMailDomain(senderMail));
String hostName = msi.getSmtpServer();
String sender_Mail = senderMail == null ? msi.getMailSender() : senderMail;
String sender_Name = senderName == null ? msi.getMailSenderName() : senderName;
String mailUserName = mail_userName == null ? msi.getMail_userName() : mail_userName;
String mailPassword = mail_password == null ? msi.getMail_password() : mail_password;
email.setAuthentication(mailUserName, mailPassword);
email.setHostName(hostName);
email.setSmtpPort(Integer.parseInt(smtpPort));
email.addTo(toEmail, toName);
email.setFrom(sender_Mail, sender_Name);
email.setSubject(subject);
// email.setContent("HtmlEmail", "text/plain; charset=utf-8");
email.setHtmlMsg(htmlMsg);
email.setTextMsg("Your email client does not support HTML messages");
email.setDebug(true);
email.send();
} catch (EmailException e) {
e.printStackTrace();
throw e;
}
}
代码示例来源:origin: stackoverflow.com
import org.apache.commons.mail.DefaultAuthenticator;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.HtmlEmail;
import play.mvc.Controller;
import play.mvc.Result;
public class MailController extends Controller {
public Result sendEmail() throws EmailException {
HtmlEmail email = new HtmlEmail();
String authuser = "..........@gmail.com";
String authpwd = "XXXXXX";
email.setSmtpPort(587);
email.setAuthenticator(new DefaultAuthenticator(authuser, authpwd));
email.setDebug(true);
email.setHostName("smtp.gmail.com");
email.setFrom("from@gmail.com", "SenderName");
email.setSubject("TestMail");
email.setHtmlMsg("<html><body><h1>welcome to u</h1></body></html>");
email.addTo("to@gmail.com", "receiver name");
email.setTLS(true);
email.send();
return play.mvc.Results.ok("Success");
}
}
代码示例来源:origin: stackoverflow.com
email.setDebug(true);
内容来源于网络,如有侵权,请联系作者删除!