# v3 API Kotlin Code Example

> \[!NOTE]
>
> We recommend using SendGrid Java, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-java), with full documentation.

> \[!NOTE]
>
> Do you have an [API Key](https://app.sendgrid.com/settings/api_keys) yet? If not, go get one. You're going to need it to integrate!

## Using SendGrid's Java Library

```kotlin
// using SendGrid's Java Library
// https://github.com/sendgrid/sendgrid-java
import com.sendgrid.*;
import java.io.IOException;

class Example {
  private fun sendEmail() {

        val sendgrid = SendGrid("SENDGRID_APIKEY")
        val email = SendGrid.Email()

        email.addTo("test@sendgrid.com")
        email.setFrom("you@example.com")
        email.setSubject("Sending with SendGrid is Fun")
        email.setHtml("and easy to do anywhere, even with Kotlin")

        val response = sendgrid.send(email)
  }
}
```
