Open Source Go Library to Send Email Messages
Free GO API, to send emails using SMTP Server.
GoEmail is an simple open source GO API for sending email messages. Using the API, you can send email using SMTP server, but the API provides the flexablility to send email message using local postfix. The API is lightweight and has no external dependencies when you are using Go 1.5 where as for the API to work you need atleast Go version 1.2 or greater. While using the SMPT connection, the API allows sending multiple emails using the same SMTP connection.
The API provides a bunch of feautes for the developers to ease the Email sending operation within GO. The developers can send SMPT emails, add attachments in email, embed images in your message and use HTML or text templates for generating a new email message. The API automatically encodes special character in the message and provides supports for SSL and TLS certificates.
At A Glance
An overview of go-email features.
- Create Email
- From, To, Cc, Bcc
- Emabed Images
- Text Email
- HTML Email
Go-Email requires the following
- Go v1.2 or above. With Go 1.5, no external dependencies are used
Getting Started with Go-Email
The recommended way to go-email into your project is by using GitHub. Please use the following command for a smooth installation.
Install Go-Email via GitHub
go get gopkg.in/gomail.v2
Free GO API to Send Email Messages
The open-source API Go provides an efficent way to compose email message via SMTP connection. In order to create a new email, you can create a new message instance by using NewMessage() method. The API provides different methods to set From, To, Subject and Body. In order to set From, To & Subject, you can use SetHeader() method of the API. Similary for the insert data in body of the email, you use SetBody() method of the API. Once, you have your email content ready you can open a new SMTP connection NewDialer() method by provinding SMPT connection details. Once you have your connention open, the message can be delivered to the destination.