https://github.com/sendgrid/smtpapi-go
SendGrids smtpapi library in Golang
https://github.com/sendgrid/smtpapi-go
mailpipeline
Last synced: 20 days ago
JSON representation
SendGrids smtpapi library in Golang
- Host: GitHub
- URL: https://github.com/sendgrid/smtpapi-go
- Owner: sendgrid
- License: mit
- Created: 2013-12-21T23:27:47.000Z (over 12 years ago)
- Default Branch: main
- Last Pushed: 2023-04-10T00:15:08.000Z (almost 3 years ago)
- Last Synced: 2025-09-05T16:45:50.208Z (7 months ago)
- Topics: mailpipeline
- Language: Go
- Homepage: https://sendgrid.com
- Size: 289 KB
- Stars: 32
- Watchers: 192
- Forks: 46
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

[](https://github.com/sendgrid/smtpapi-go/actions/workflows/test-and-deploy.yml)
[](LICENSE)
[](https://twitter.com/sendgrid)
[](https://github.com/sendgrid/smtpapi-go/graphs/contributors)
[](https://goreportcard.com/report/github.com/sendgrid/smtpapi-go)
[](https://godoc.org/github.com/sendgrid/smtpapi-go)
**This is a simple library to simplify the process of using [SendGrid's](https://sendgrid.com) [X-SMTPAPI](http://sendgrid.com/docs/API_Reference/SMTP_API/index.html) with the Go programming language**
# Table of Contents
* [Announcements](#announcements)
* [Installation](#installation)
* [Quick Start](#quick-start)
* [Usage](#usage)
* [How to Contribute](#how-to-contribute)
* [About](#about)
* [Support](#support)
* [License](#license)
# Announcements
All the updates to this library are documented in our [CHANGELOG](CHANGELOG.md).
## Supported Versions
* Go version 1.11-1.17
## Prerequisites
* The SendGrid service, starting at the [free level](https://sendgrid.com/free?source=smtpapi-go)
## Install the Package
```bash
go get github.com/sendgrid/smtpapi-go
```
## Setup the Environment Variables
### Environment Variable
Update the development environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys), for example:
```bash
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
```
```go
package main
import (
"github.com/sendgrid/smtpapi-go"
"fmt"
)
func main() {
header := smtpapi.NewSMTPAPIHeader()
header.AddTo("test@example.com")
fmt.Println(header.JSONString())
}
```
# Usage
* [SendGrid Docs](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html)
* [Example Code](examples)
# How to Contribute
We encourage contribution to our libraries, please see our [CONTRIBUTING](CONTRIBUTING.md) guide for more details on contributions.
Quick links:
* [Feature Request](CONTRIBUTING.md#feature-request)
* [Bug Reports](CONTRIBUTING.md#submit-a-bug-report)
* [Improvements to the Codebase](CONTRIBUTING.md#improvements-to-the-codebase)
* [Review Pull Requests](CONTRIBUTING.md#code-reviews)
smtpapi-go is maintained and funded by Twilio SendGrid, Inc. The names and logos for smtpapi-go are trademarks of Twilio SendGrid, Inc.
If you need help with SendGrid, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com).
# License
[The MIT License (MIT)](LICENSE)