org.apache.commons.mail.Email.setSSL()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(205)

本文整理了Java中org.apache.commons.mail.Email.setSSL()方法的一些代码示例,展示了Email.setSSL()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Email.setSSL()方法的具体详情如下:
包路径:org.apache.commons.mail.Email
类名称:Email
方法名:setSSL

Email.setSSL介绍

[英]Sets whether SSL/TLS encryption should be enabled for the SMTP transport upon connection (SMTPS/POPS). See EMAIL-105 for reason of deprecation.
[中]设置是否应在连接时为SMTP传输(SMTPS/POPS)启用SSL/TLS加密。有关反对理由,请参阅电子邮件-105。

代码示例

代码示例来源:origin: com.bbossgroups.activiti/activiti-engine

  1. protected void setMailServerProperties(Email email) {
  2. ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
  3. String host = processEngineConfiguration.getMailServerHost();
  4. if (host == null) {
  5. throw new ActivitiException("Could not send email: no SMTP host is configured");
  6. }
  7. email.setHostName(host);
  8. int port = processEngineConfiguration.getMailServerPort();
  9. email.setSmtpPort(port);
  10. email.setSSL(processEngineConfiguration.getMailServerUseSSL());
  11. email.setTLS(processEngineConfiguration.getMailServerUseTLS());
  12. String user = processEngineConfiguration.getMailServerUsername();
  13. String password = processEngineConfiguration.getMailServerPassword();
  14. if (user != null && password != null) {
  15. email.setAuthentication(user, password);
  16. }
  17. }

代码示例来源:origin: com.ning.billing/killbill-util

  1. email.setSSL(config.useSSL());

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-core

  1. email.setSSL(smtpSsl);
  2. email.setTLS(smtpTls);
  3. email.setSubject(subject);

相关文章