Skip to content
/ Email Public

FetchWeb Email is a Simple SMTP Email API written in Go with no dependencies outside of the standard library.

License

Notifications You must be signed in to change notification settings

FetchWeb/Email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FetchWeb Mail

License: MIT Go Report Card Go Doc GitHub release

Introduction

FetchWeb Email is a simple SMTP Email API written in Go with no dependencies outside of the Go standard library.

Setup Example

package main

import (
	"encoding/json"
	"io/ioutil"

	email "github.com/FetchWeb/Email"
)

func main() {
	// Initailise credentials & data objects.
	creds := &email.Credentials{
		Address: "<Sending email address>",
		Hostname: "<Hostname of SMTP Server>",
		Name: "<Name appearing on email>",
		Port: "<Port email being sent on>",
		Password "<Password to email account>"
	}
	data := &email.Data{
		Attachments: make(map[string]*email.Attachment)
	}

	// Add email body.
	data.Body = "Hello world from FetchWeb Mail!"

	// Add attachment from file.
	if err := data.AddAttachmentFromFile("<Attachment directory>", false); err != nil {
		panic(err)
	}

	// Send email.
	if err := email.Send(creds, data); err != nil {
		panic(err)
	}
}

About

FetchWeb Email is a Simple SMTP Email API written in Go with no dependencies outside of the standard library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published