source: src/main/java/com/tourMate/services/impl/MailingServiceImpl.java@ 0f5aa27

Last change on this file since 0f5aa27 was 0f5aa27, checked in by darsov2 <62809499+darsov2@…>, 12 months ago

ouath, mailing impl

  • Property mode set to 100644
File size: 773 bytes
Line 
1package com.tourMate.services.impl;
2
3import com.tourMate.services.MailingService;
4import org.springframework.mail.SimpleMailMessage;
5import org.springframework.mail.javamail.JavaMailSender;
6import org.springframework.stereotype.Service;
7
8@Service
9public class MailingServiceImpl implements MailingService {
10
11 private final JavaMailSender emailSender;
12
13 public MailingServiceImpl(JavaMailSender emailSender) {
14 this.emailSender = emailSender;
15 }
16
17 @Override
18 public void sendMail(String to, String subject, String messageText) {
19 SimpleMailMessage mail = new SimpleMailMessage();
20 mail.setFrom("Trip2MK");
21 mail.setTo(to);
22 mail.setSubject(subject);
23 mail.setText(messageText);
24 emailSender.send(mail);
25 }
26}
Note: See TracBrowser for help on using the repository browser.