Open Source Go Library to Send Email Messages
Free GO API, to send emails using SMTP Server.
GoEmail is a simple open source GO API for sending email messages. Using the API, you can send emails using an SMTP server, but the API provides the flexibility to send an email message using local postfix. The API is lightweight and has no external dependencies when you are using Go 1.5 whereas for the API to work you need at least 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 features for the developers to ease the Email sending operation within GO. The developers can send SMPT emails, add attachments to emails, embed images in your message, and use HTML or text templates for generating a new email message. The API automatically encodes special characters in the message and provides support for SSL and TLS certificates.
Getting Started with Go-Email
The recommended way to add 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 Go API provides an efficient 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 providing SMPT connection details. Once you have your connection open, the message can be delivered to the destination.