use of org.springframework.mail.SimpleMailMessage in project spring-rest-security-boilerplate by springboilerplate.
the class Mailer method resendVerificationToken.
public void resendVerificationToken(AppUser user, VerificationToken token) {
final SimpleMailMessage email = constructResendVerificationTokenEmail(user, token);
System.out.println("New token is : " + token.getToken());
if (SEND_MAIL == true)
mailSender.send(email);
System.out.println(email);
}
use of org.springframework.mail.SimpleMailMessage in project spring-rest-security-boilerplate by springboilerplate.
the class Mailer method registrationTokenEmail.
public void registrationTokenEmail(OnRegistrationCompleteEvent event, AppUser user, String token) {
final SimpleMailMessage email = constructRegistrationEmailMessage(event, user, token);
if (SEND_MAIL == true)
mailSender.send(email);
System.out.println(email);
}
use of org.springframework.mail.SimpleMailMessage in project ngtesting-platform by aaronchen2k.
the class SystemConfig method simpleMailMessage.
@Bean
public SimpleMailMessage simpleMailMessage() {
SimpleMailMessage mailMessage = new SimpleMailMessage();
mailMessage.setFrom(mailUserName);
mailMessage.setSubject("来自ngtesting.com的邮件");
return mailMessage;
}
use of org.springframework.mail.SimpleMailMessage in project tutorials-java by Artister.
the class ApplicationTests method sendSimpleMail.
@Test
public void sendSimpleMail() throws Exception {
SimpleMailMessage message = new SimpleMailMessage();
message.setFrom(from);
message.setTo(from);
message.setSubject("主题:简单邮件");
message.setText("测试邮件内容");
mailSender.send(message);
}
use of org.springframework.mail.SimpleMailMessage in project onebusaway-application-modules by camsys.
the class ForgotPasswordAction method execute.
@Override
public String execute() {
// Don't check permissions.
SimpleMailMessage msg = getMessage();
try {
_mailSender.send(msg);
_log.info("Sent email.");
} catch (Exception e) {
_log.error("Could not send email: " + e.getMessage());
throw new RuntimeException("Unable to send email.");
}
return SUCCESS;
}
Aggregations