本文整理汇总了Java中org.springframework.mail.MailMessage类的典型用法代码示例。如果您正苦于以下问题:Java MailMessage类的具体用法?Java MailMessage怎么用?Java MailMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MailMessage类属于org.springframework.mail包,在下文中一共展示了MailMessage类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: configure
import org.springframework.mail.MailMessage; //导入依赖的package包/类
@Override @SuppressWarnings("resource")
protected void configure() {
R01F.initSystemEnv();
bind(MailManager.class).toInstance(new MailManager());
ApplicationContext springAppContext = new AnnotationConfigApplicationContext(SpringConfiguration.class);
bind(BeanFactory.class).toInstance(springAppContext);
// Bind spring managed beans
// (remember that spring binds the @Bean-annotated method with the method name)
bind(JavaMailSender.class).toProvider(SpringIntegration.fromSpring(JavaMailSender.class,
"mailSender"));
bind(MailMessage.class).toProvider(SpringIntegration.fromSpring(MailMessage.class,
"mailMessageTemplate"));
bind(VelocityEngine.class).toProvider(SpringIntegration.fromSpring(VelocityEngine.class,
"velocityEngine"));
}
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:19,代码来源:GuiceSpringTest.java
示例2: welcomeMail
import org.springframework.mail.MailMessage; //导入依赖的package包/类
/**
* Perform the Account to MailMessage transformation.
*/
@Transformer
public MailMessage welcomeMail(Account account) {
SimpleMailMessage mailMessage = new SimpleMailMessage();
mailMessage.setFrom("Greenhouse <[email protected]>");
mailMessage.setTo(account.getEmail());
mailMessage.setSubject("Welcome to the Greenhouse!");
StringTemplate textTemplate;
textTemplate = welcomeTemplateFactory.getStringTemplate();
textTemplate.put("firstName", account.getFirstName());
textTemplate.put("profileUrl", account.getProfileUrl());
mailMessage.setText(textTemplate.render());
return mailMessage;
}
开发者ID:mqprichard,项目名称:spring-greenhouse-clickstart,代码行数:17,代码来源:WelcomeMailTransformer.java
示例3: name
import org.springframework.mail.MailMessage; //导入依赖的package包/类
@Bean @Scope("singleton") // the method name (mockMessageService) becomes the bean "name"
MailMessage mailMessageTemplate() {
SimpleMailMessage outMsgTemplate = new SimpleMailMessage();
return outMsgTemplate;
}
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:6,代码来源:GuiceSpringTest.java
注:本文中的org.springframework.mail.MailMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论