GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nylas-samples/java-email-send: Send an email with the Nylas Java SDK!

This repository was archived by the owner on May 23, 2024. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
src/main/java
src/main/java
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Send an email with the Nylas Java SDK!

Using this sample, you can quickly see how easy it is to start sending emails with Nylas. This readme will cover what you need to get started with this sample, and provide one way you can run it. You are welcome to run it using something besides IntelliJ and Maven. If you do, feel free to reach out with suggestions for this readme.

Prerequisites

To try out this project you'll need:

  • A Nylas developer account - sign up for an account here.
  • Familiarity with Java

Get Started - Installation

If you want to follow along with these instructions, you will need IntelliJ, Maven, and Java. Now that all of these tools are easily installable using homebrew, set up is simple.

Install Java

To install Java, just type:

brew install java

Install Maven

To install Maven, type:

brew install maven

Install IntelliJ

Can you guess what you'll be typing? This one's a little bit less intuitive, but you can install IntelliJ with:

brew install intellij-idea-ce

Set up the Project

There are a few ways you can set up your project. A really simple way to do this with IntelliJ is like this:

  1. Open IntelliJ and start a new empty project.

  2. Give your project a name in the Name field.

  3. Make sure you choose Java for the language.

  4. For Build system, choose Maven.

  5. Click Create.

  6. Your pom.xml file will look like this:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>example</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>18</maven.compiler.source>
        <maven.compiler.target>18</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

</project>
  1. Open the pom.xml file from this repository and copy everything between the tags.

  2. Paste what you copied into your pom.xml file, between the end tag and the tag. It will look like this:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>example</artifactId>
    <version>1.0-SNAPSHOT</version>
<dependencies>
        <dependency>
            <groupId>com.nylas.sdk</groupId>
            <artifactId>nylas-java-sdk</artifactId>
            <version>1.13.0</version>
        </dependency>
</dependencies>
<properties>
        <maven.compiler.source>18</maven.compiler.source>
        <maven.compiler.target>18</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

</project>
  1. In the upper right corner of where you pasted your dependencies, you'll see a little m icon with a recycle button next to it. Press that to refresh your dependencies and add them.

You've now set up your dependencies for your project.

Add a run/debug configuration

The next step is to get a run/debug configuration so we can add our environment variables.

  1. Now let's add a run/debug configuration. Click the drop down that says Current File in the top right.

  2. Choose Edit Configurations.

  3. Likely, there's no configurations provided for your project, so click Add new.

  4. From the list of configuration choices, choose Application.

  5. Give your configuration a name in the Name field.

  6. For the Main class field, type emailSend.

  7. Now it's time to add environment variables to our configuration.

  8. Retrieve your access token out of your Nylas dashboard. If you forgot or lost your token, you can read our documentation about Generating Access Tokens for help.

  9. In the Environment variables field in your configuration in IntelliJ, type ACCESS_TOKEN=your token.

  10. You need to add two more - RECIPIENT_NAME and RECIPIENT_EMAIL.

  11. After adding your variables, click Apply and then OK.

You're now ready to build and run your application!

About

Send an email with the Nylas Java SDK!

Topics

emailjavanylasnylas-api-v2sample

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.