Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bootique/bootique-simplejavamail
Provides Simple Java Mail integration with Bootique
https://github.com/bootique/bootique-simplejavamail
bootique javamail
Last synced: about 2 months ago
JSON representation
Provides Simple Java Mail integration with Bootique
- Host: GitHub
- URL: https://github.com/bootique/bootique-simplejavamail
- Owner: bootique
- License: apache-2.0
- Created: 2020-05-03T08:00:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-23T18:09:50.000Z (8 months ago)
- Last Synced: 2024-04-23T20:11:44.250Z (8 months ago)
- Topics: bootique, javamail
- Language: Java
- Homepage: https://bootique.io
- Size: 95.7 KB
- Stars: 0
- Watchers: 10
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![build test deploy](https://github.com/bootique/bootique-simplejavamail/actions/workflows/maven.yml/badge.svg)](https://github.com/bootique/bootique-simplejavamail/actions/workflows/maven.yml)
[![Maven Central](https://img.shields.io/maven-central/v/io.bootique.simplejavamail/bootique-simplejavamail.svg?colorB=brightgreen)](https://search.maven.org/artifact/io.bootique.simplejavamail/bootique-simplejavamail/)# bootique-simplejavamail
Provides [Simple Java Mail](http://www.simplejavamail.org/) integration with [Bootique](https://bootique.io).
## Usage
Include ```bootique-bom```:
```xml
io.bootique.bom
bootique-bom
3.0-M4
pom
import
```
Import Simple Java Mail integration:
```xmlio.bootique.simplejavamail
bootique-simplejavamail```
Configure the app:
```yaml
simplejavamail:# Mail delivery is disabled by default to prevent inadvertent spamming when the app is in development. This property
# needs to be flipped to "false" if you want mail to be actually sent to someone.
disabled: false# Configure named mailers. If "mailers" section is absent, the default mailer is created pointing to "localhost:25"
mailers:
main: # arbitrary name of the mailer
smtpServer: example.org
smtpPort: 3025
transportStrategy: SMTPS
```Send mail:
```java
@Inject
Mailers mailers;public void sendMail() {
Email email = EmailBuilder.startingBlank()
.from("[email protected]")
.to("[email protected]")
.withSubject("Hi!")
.withPlainText("Hello world..")
.buildEmail();// if only one mailer is configured in YAML, it is assumed to be the default mailer
mailers.getDefaultMailer().sendMail(email, false);
}
```