Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

com.github.migangqui:spring-email-api-kotlin

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.github.migangqui:spring-email-api-kotlin

Kotlin API to send emails in Spring

  • 1.2.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

Spring Email API (Java/Kotlin)

GitHub last commit Maven Central

It is an API for Java and Kotlin to send emails with Spring. To add to your project...

Add dependency to Maven or Gradle:

For Java:

<dependency>
	<groupId>com.github.migangqui</groupId>
	<artifactId>spring-email-api-java</artifactId>
	<version>${currentVersion}</version>
</dependency>
implementation 'com.github.migangqui:spring-email-api-java:${currentVersion}'

For Kotlin:

<dependency>
	<groupId>com.github.migangqui</groupId>
	<artifactId>spring-email-api-kotlin</artifactId>
	<version>${currentVersion}</version>
</dependency>
implementation 'com.github.migangqui:spring-email-api-kotlin:${currentVersion}'

${currentVersion} is 1.2.0

Add the following properties in application.yml of the project

spring:
  mail:
    default-encoding: UTF-8
    host: # for example: smtp.gmail.com
    username: # Your email
    password: # Your email pass
    port: # SMPT port, for exaple: 25, 587
    properties:
      mail:
        transport.protocol: smtp
# Optional properties
#        smtp:
#          ssl:
#            trust: '*'
#          auth: true
#          starttls:
#            enable: true
#            required: true

Enable async

Add @EnableAsync annotation in your Spring Application class to enable async send method.

Component scan

It's not necessary add the package to component scan with this new version.

How to use

You have to inject EmailSender as dependency in your Spring component. The service provide these methods:

Java
public interface EmailSender {
    SendEmailResult send(Email email);
        
    Future<SendEmailResult> sendAsync(Email email);
}
Kotlin
interface EmailSender {
    fun send(email: Email): SendEmailResult

    fun sendAsync(email: Email): Future<SendEmailResult>
}

FAQs

Package last updated on 30 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc