This sample will show you to easily send your email with the Nylas Kotlin SDK.
- Java 18.0.2
- Maven 3.8.6
You'll need the following values:
V3_TOKEN_API = <API_KEY>
GRANT_ID = <GRANT_ID>
NYLAS_API_URI = <NYLAS_API_URI>
Add the above values to a new .env
file:
$ touch .env # Then add your env variables
org.slf4j / slf4j-simple / 2.0.9
com.nylas.sdk / nylas / 2.4.0
io.github.cdimascio / dotenv-java / 6.4.1
To compile the application we need to use this maven
commands:
mvn clean compile
mvn package
Run the following maven
command:
$ java -cp $KOTLIN_LIB/kotlin-stdlib.jar -jar target/kotlin-send-email-1.0-SNAPSHOT-jar-with-dependencies.jar
When your message is successfully sent, you'll get the following output in your terminal:
Message "With Love, from Nylas" was sent with ID 111111111111111111
Visit our Nylas Java SDK documentation to learn more.