We recommend using SendGrid Java, our client library, available on GitHub, with full documentation.
Do you have an API Key yet? If not, go get one. You're going to need it to integrate!
_19// using SendGrid's Java Library_19// https://github.com/sendgrid/sendgrid-java_19import com.sendgrid.*;_19import java.io.IOException;_19_19class Example {_19 private fun sendEmail() {_19_19 val sendgrid = SendGrid("SENDGRID_APIKEY")_19 val email = SendGrid.Email()_19_19 email.addTo("test@sendgrid.com")_19 email.setFrom("you@youremail.com")_19 email.setSubject("Sending with SendGrid is Fun")_19 email.setHtml("and easy to do anywhere, even with Kotlin")_19_19 val response = sendgrid.send(email)_19 }_19}