Last change
on this file was 0f5aa27, checked in by darsov2 <62809499+darsov2@…>, 12 months ago |
ouath, mailing impl
|
-
Property mode
set to
100644
|
File size:
773 bytes
|
Rev | Line | |
---|
[0f5aa27] | 1 | package com.tourMate.services.impl;
|
---|
| 2 |
|
---|
| 3 | import com.tourMate.services.MailingService;
|
---|
| 4 | import org.springframework.mail.SimpleMailMessage;
|
---|
| 5 | import org.springframework.mail.javamail.JavaMailSender;
|
---|
| 6 | import org.springframework.stereotype.Service;
|
---|
| 7 |
|
---|
| 8 | @Service
|
---|
| 9 | public 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.