Package best.skn.mail.services
Interface MailSenderInterface
- All Known Implementing Classes:
MailSenderService
@Component
public interface MailSenderInterface
Mail Sender Service Interface
- Since:
- 2024-03-07
- Version:
- 1.2.2
- Author:
- SKN
- Use Case:
- Spring Boot Reactive
- Dedicated To:
- Trina, Logno and Atoshi
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<String> Method to send basic mailreactor.core.publisher.Mono<String> Method to send basic mail with attachmentreactor.core.publisher.Mono<String> sendMailWithHtmlTemplate(String from, String to, String subject, String templateName, org.thymeleaf.context.Context context) Method to send mail with HTML templatereactor.core.publisher.Mono<String> sendMailWithHtmlTemplateAndAttachment(String from, String to, String subject, String templateName, org.thymeleaf.context.Context context, String filePath) Method to send mail with HTML template and attachment
-
Method Details
-
sendMail
reactor.core.publisher.Mono<String> sendMail(String from, String to, String subject, String body) throws jakarta.mail.MessagingException Method to send basic mail- Parameters:
from- a String which must be a valid email address from whom the mail will be sentto- a String which must be a valid email address to whom the mail will be sentsubject- a String containing the subject of the mailbody- a String containing the main body of the mail- Returns:
- a Mono of String as a response
- Throws:
jakarta.mail.MessagingException- a messaging exception if the mail is not sent successfully- Since:
- v1.0.0
-
sendMailWithAttachment
reactor.core.publisher.Mono<String> sendMailWithAttachment(String from, String to, String subject, String body, String filePath) throws jakarta.mail.MessagingException Method to send basic mail with attachment- Parameters:
from- a String which must be a valid email address from whom the mail will be sentto- a String which must be a valid email address to whom the mail will be sentsubject- a String containing the subject of the mailbody- a String containing the main body of the mailfilePath- a String containing the file path to the attachment- Returns:
- a Mono of String as a response
- Throws:
jakarta.mail.MessagingException- a messaging exception if the mail is not sent successfully- Since:
- v1.0.0
-
sendMailWithHtmlTemplate
reactor.core.publisher.Mono<String> sendMailWithHtmlTemplate(String from, String to, String subject, String templateName, org.thymeleaf.context.Context context) throws jakarta.mail.MessagingException Method to send mail with HTML template- Parameters:
from- a String which must be a valid email address from whom the mail will be sentto- a String which must be a valid email address to whom the mail will be sentsubject- a String containing the subject of the mailtemplateName- a String containing the template name for the HTML templatecontext- a Thymeleaf Context for the HTML template- Returns:
- a Mono of String as a response
- Throws:
jakarta.mail.MessagingException- a messaging exception if the mail is not sent successfully- Since:
- v1.0.0
-
sendMailWithHtmlTemplateAndAttachment
reactor.core.publisher.Mono<String> sendMailWithHtmlTemplateAndAttachment(String from, String to, String subject, String templateName, org.thymeleaf.context.Context context, String filePath) throws jakarta.mail.MessagingException Method to send mail with HTML template and attachment- Parameters:
from- a String which must be a valid email address from whom the mail will be sentto- a String which must be a valid email address to whom the mail will be sentsubject- a String containing the subject of the mailtemplateName- a String containing the template name for the HTML templatecontext- a Thymeleaf Context for the HTML templatefilePath- a String containing the file path to the attachment- Returns:
- a Mono of String as a response
- Throws:
jakarta.mail.MessagingException- a messaging exception if the mail is not sent successfully- Since:
- v1.0.0
-