use of org.springframework.mail.SimpleMailMessage in project bitcampSCOpen2017 by ryuyj.
the class SimpleRegistrationNotifier method sendMail.
public void sendMail(Member member) {
// 보내는 정보를 SimpleMailMessage 객체에 담는다.
SimpleMailMessage message = new SimpleMailMessage();
message.setSubject("[회원가입안내]" + member.getMember_name() + "님 회원가입을 축하합니다.");
message.setFrom("bpppys@Gmail.com");
message.setText("회원가입이 성공");
message.setTo(member.getMember_id());
/*// 메일 보내기 설정
SimpleMailMessage message = new SimpleMailMessage();
// 제목설정
message.setSubject(member.getMember_name() + "님 회원가입을 감사드립니다.");
// 내용 설정
message.setText(member.getMember_name() + "님 회원가입을 감사드립니다.");
// 가입회원의 메일주소 설정
message.setTo(member.getMember_id());
// 보내는 메일 설정
message.setFrom("bpppys@Gmail.com");*/
mailSender.send(message);
}
use of org.springframework.mail.SimpleMailMessage in project bitcampSCOpen2017 by ryuyj.
the class SimpleRegistrationNotifier method sendMail.
public void sendMail(String email, String msg) {
// 보내는 정보를 SimpleMailMessage 객체에 담는다.
SimpleMailMessage message = new SimpleMailMessage();
message.setSubject("[회원가입안내] 회원가입을 축하합니다.");
message.setFrom("bit@gmail.com");
message.setText(msg);
message.setTo(email);
mailSender.send(message);
}
use of org.springframework.mail.SimpleMailMessage in project spring-rest-security-boilerplate by springboilerplate.
the class Mailer method constructResendVerificationTokenEmail.
private final SimpleMailMessage constructResendVerificationTokenEmail(final AppUser user, final VerificationToken newToken) {
SimpleMailMessage email = new SimpleMailMessage();
email.setTo(user.getEmail());
email.setSubject("Resend Registration Token");
email.setText("New token is " + newToken.getToken());
email.setFrom(env.getProperty("support.email"));
return email;
}
use of org.springframework.mail.SimpleMailMessage in project spring-rest-security-boilerplate by springboilerplate.
the class Mailer method constructRegistrationEmailMessage.
private final SimpleMailMessage constructRegistrationEmailMessage(final OnRegistrationCompleteEvent event, final AppUser user, final String token) {
final String recipientAddress = user.getEmail();
final String subject = "Registration Confirmation";
// final String confirmationUrl = event.getAppUrl() +
// "/registrationConfirm.html?token=" + token;
// final String message = messages.getMessage("message.regSucc", null,
// event.getLocale());
final SimpleMailMessage email = new SimpleMailMessage();
email.setTo(recipientAddress);
email.setSubject(subject);
// just sending token
email.setText("Token is " + token);
email.setFrom(env.getProperty("support.email"));
return email;
}
use of org.springframework.mail.SimpleMailMessage in project spring-boot by Linda-Tan.
the class HelloWorldApplicationTests method sendSimpleEmail.
@Test
public void sendSimpleEmail() {
SimpleMailMessage message = new SimpleMailMessage();
// 发送者.
message.setFrom("li926893@163.com");
// 接收者.
message.setTo("318615621@qq.com");
// 邮件主题.
message.setSubject("测试邮件(邮件主题)");
// 邮件内容.
message.setText("这是邮件内容");
// 发送邮件
mailSender.send(message);
}
Aggregations