本文整理汇总了Java中org.codemonkey.simplejavamail.Mailer类的典型用法代码示例。如果您正苦于以下问题:Java Mailer类的具体用法?Java Mailer怎么用?Java Mailer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Mailer类属于org.codemonkey.simplejavamail包,在下文中一共展示了Mailer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: sendMail
import org.codemonkey.simplejavamail.Mailer; //导入依赖的package包/类
private String sendMail(Email email, MailSettings settings) {
try {
new Mailer(settings.host, settings.port, settings.user, settings.password)
.sendMail(email);
return "Mail successfully sent.";
}
catch (MailException me) {
return me.getMessage();
}
}
开发者ID:yawlfoundation,项目名称:yawl,代码行数:11,代码来源:MailService.java
示例2: sendMail
import org.codemonkey.simplejavamail.Mailer; //导入依赖的package包/类
public void sendMail(String recipient, String subject, String text) {
final Email email = new Email();
email.setFromAddress("Oregami", "[email protected]");
email.setSubject(subject);
email.addRecipient(recipient, recipient, RecipientType.TO);
email.setText(text);
new Mailer(mailConfiguration.getHost(), Integer.parseInt(mailConfiguration.getPort()), mailConfiguration.getUsername(), mailConfiguration.getPassword()).sendMail(email);
}
开发者ID:oregami,项目名称:oregami-server,代码行数:12,代码来源:MailHelper.java
示例3: OAuth2Application
import org.codemonkey.simplejavamail.Mailer; //导入依赖的package包/类
public OAuth2Application() {
super();
packages("com.oauth2cloud.server.rest");
configureSwagger(this);
register(new AbstractBinder() {
@Override
protected void configure() {
EncryptedStringConverter.init(Environment.ENCRYPTION_SECRET);
final JAXRSEntityManagerFactory jrem = JAXRSEntityManagerFactory.builder(ENTITY_MANAGER_FACTORY_NAME)
.withUrl(Environment.JDBC_CONNECTION_STRING)
.withUser(Environment.JDBC_CONNECTION_USERNAME)
.withPassword(Environment.JDBC_CONNECTION_PASSWORD)
.withPersistenceUnit(PERSISTENCE_UNIT_NAME)
.withChangelogFile(DB_MASTER_CHANGELOG_XML_PATH)
.withShowSql(Environment.SHOW_HIBERNATE_SQL)
.withContext(Environment.LIQUIBASE_CONTEXT)
.withAdditionalProperties(ENTITY_MANAGER_FACTORY_CONFIG)
.build();
initializeDefaultClientCredentials(jrem);
// this is used to talk to the DB via JPA entity manager
bindFactory(jrem).to(EntityManager.class).in(RequestScoped.class).proxy(true);
// create the mailer that uses amazon
final Mailer mailer = new Mailer(
Environment.SMTP_HOST,
Environment.SMTP_PORT,
Environment.SMTP_USERNAME,
Environment.SMTP_PASSWORD,
TransportStrategy.SMTP_TLS
);
final Properties mailerProperties = new Properties();
mailerProperties.put(MAIL_SMTP_STARTTLS_REQUIRED, "true");
mailer.applyProperties(mailerProperties);
// this is used to send e-mails
bind(mailer).to(Mailer.class);
// this is used for generating e-mails from freemarker templates
bind(new EmailTemplateFreemarkerConfiguration()).to(Configuration.class);
bind(new GoogleTokenValidator()).to(GoogleTokenValidator.class);
bind(new FacebookTokenValidator()).to(FacebookTokenValidator.class);
}
});
}
开发者ID:moodysalem,项目名称:oauth-service,代码行数:51,代码来源:OAuth2Application.java
示例4: MailerServiceAdapter
import org.codemonkey.simplejavamail.Mailer; //导入依赖的package包/类
public MailerServiceAdapter() {
this.mailer =
new Mailer(MAILER_HOST, MAILER_PORT, MAILER_USERNAME, MAILER_PASSWORD, TransportStrategy.SMTP_SSL);
}
开发者ID:necavit-fib,项目名称:AS,代码行数:5,代码来源:MailerServiceAdapter.java
注:本文中的org.codemonkey.simplejavamail.Mailer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论