1. Products
  2.   Email
  3.   GO
  4.   Email
 
  

Open Source Go API for Email Messages

Free GO Library for Generating Email Message with Attachments and Supports IMAP, POP3 & SMTP.

What is Email Library?

Email is an Open Source robust and flexible email library for GO developers. It is a lightweight and simple email package to provide an email interface for humans. Using the API you can create a new email, set From, To BCC and CC set email addresses in different formats, use text & HTML in the email body, and manage attachments. Furthermore, the API allows the designing of custom email headers and allows reading receipts.

The open source Go Email Library provided by Jordan Wright provides a straightforward and easy way to incorporate email functionality into your Go applications. Using the API you can create an email for any type that implements the io.Reader interface e.g. you can send emails using your Gmail account by setting email properties directly from the struct.

The Go Email Library simplifies the process of sending emails in Go applications. Using advanced features like attaching files, embedding images, and sending HTML content, it caters to a variety of use cases. By following the examples provided, users can quickly integrate email functionality into their Go projects with ease and reliability. The library is very helpful in sending transactional emails, newsletters, or notifications and by mastering the library, developers can enhance the communication capabilities of their Go applications and deliver compelling email experiences to their users.

Previous Next

Getting Started with Email

The easiest way to install Email is via GitHub. You can use the following command to install Email Go API

install Email API via GitHub

go get github.com/jordan-wright/email

Create New Messages via Free Go API

The Open Source API Email library enables software developers to create email messages via GO. Creating a new email with the API is pretty simple. You can start an email email by creating a new email instance by using emial.NewEmail() method. You can set From, To BCC, and CC by using the properties of the newly created email instance - email.From, email.To email.BCC and email.Cc respectively. Similarly setting Subject and Body is piece of cake as well. You can set the subject using, email.Subject and set body either by using email.Text or email.HTML method. When you have your email content ready, you can send it using email.Send() method. The following example demonstrates how software developers can send email messages using Gmail via go applications.

How to Send Email Messages using Gmail inside Go Applications?

e := email.NewEmail()
e.From = "Jordan Wright "
e.To = []string{"test@example.com"}
e.Bcc = []string{"test_bcc@example.com"}
e.Cc = []string{"test_cc@example.com"}
e.Subject = "Awesome Subject"
e.Text = []byte("Text Body is, of course, supported!")
e.HTML = []byte("

Fancy HTML is supported, too!

") e.Send("smtp.gmail.com:587", smtp.PlainAuth("", "test@gmail.com", "password123", "smtp.gmail.com"))

Free GO API to Create Email with Attachments

Email API provides features for generating a message with attachments inside GO applications. Attachments are just like any other properties of email API. Just like you set From, To, Ccc, BCC, and subject, you can add attachments using email.AttachFile() method. Moreover, the library offers a range of customization options to tailor your emails to your specific requirements. You can add attachments, set custom headers, include HTML content, and even embed inline images within your emails.

How to Send Email Messages using Gmail inside Go Applications?

e := NewEmail()
e.AttachFile("test.txt")
 English