๐Ÿ“ฎ Simple (but useful) email sender written in pure Go v1.17. Support HTML templates and attachments.

Overview

๐Ÿ“ฎ Go Email Sender

Go Reference

Simple (but useful) email sender written in pure Go v1.17. Yes, yet another email package here! ๐Ÿ˜…

Support HTML templates and attachments.

Send HTML email

Method signature:

func (s *Sender) SendHTMLEmail(
    templatePath string,
    to []string,
    cc []string,
    subject string,
    data interface{},
    files []string,
) error

Example:

// Create a new struct for the email data.
type HTMLEmailData struct {
    Name    string
    Website string
}

// Create a new SMTP sender instance with your auth params.
sender := NewEmailSender("[email protected]", "secret", "smtp.test.com", 25)

// Send the email with an HTML template.
if err := sender.SendHTMLEmail(
    "my/templates/welcome.html", // path to the HTML template
    []string{
        "[email protected]",      // slice of emails to send
    },
    []string{
        "[email protected]", // slice of emails to send message copy
    },
    "It's a test email!",        // subject of the email
    &HTMLEmailData{
        Name:    "Vic",
        Website: "https://shostak.dev/",
    },
    []string{
        "my/files/image.jpg",    // slice of files to send
    },
); err != nil {
    // Throw error message, if something went wrong.
    return fmt.Errorf("Something went wrong: %v", err)
}

Send plain text email

Method signature:

func (s *Sender) SendPlainEmail(
    to []string,
    cc []string,
    subject string,
    data interface{},
    files []string,
) error

Example:

// Create a new SMTP sender instance with your auth params.
sender := NewEmailSender("[email protected]", "secret", "smtp.test.com", 25)

// Send the email with a plain text.
if err := sender.SendPlainEmail(
    []string{
        "[email protected]",       // slice of emails to send
    },
    []string{
        "[email protected]",  // slice of emails to send message copy
    },
    "It's a test email!",         // subject of the email
    "Here is a plain text body.", // body of the email
    []string{
        "my/files/image.jpg",     // slice of files to send
    },
); err != nil {
    // Throw error message, if something went wrong.
    return fmt.Errorf("Something went wrong: %v", err)
}

โš ๏ธ License

Apache-2.0 ยฉ Vic Shรณstak & True web artisans.

Releases(v0.0.5)
Owner
Vic Shรณstak
A Software Engineer & founder of a friendly outsource company called @truewebartisans, with excellent UX/UI knowledge and over 12 years of practical experience.
Vic Shรณstak
Using Mailchain, blockchain users can now send and receive rich-media HTML messages with attachments via a blockchain address.

Mailchain Introduction Mailchain enables blockchain-based email-like messaging with plain or rich text and attachment capabilities. Using blockchain p

Mailchain 119 Jun 22, 2022
Email-searcher - Given a domain name and real name, attempt to find an existing email for that user.

email-searcher Given a domain name and real name, attempt to find an existing email for that user. Using Run it with both the domain and name flags, l

Alex Anderson 0 Jan 2, 2022
Sending emails using email server talking to RabbitMQ and send grid server sending emails to email ids consumed from RabbitMQ

Sending emails using email server talking to RabbitMQ and send grid server sending emails to email ids consumed from RabbitMQ

Shivanshu Raj Shrivastava 1 Feb 9, 2022
An easy way to send emails with attachments in Go

PROJECT DISCONTINUED This repository only exists for archival purposes. email An easy way to send emails with attachments in Go Install go get github.

Santiago Corredoira 254 May 26, 2022
Golang package for send email. Support keep alive connection, TLS and SSL. Easy for bulk SMTP.

Go Simple Mail The best way to send emails in Go with SMTP Keep Alive and Timeout for Connect and Send. IMPORTANT Examples in this README are for v2.2

Santiago De la Cruz 333 Jun 26, 2022
An email service written in Golang

furion An email service written in Go. Architecture Diagram

NUSSU commIT 1 Dec 19, 2021
a simple api that sent spam via sms and email

a simple api that sent spam via sms and email routes: /sms /email example request with python

null 3 Oct 19, 2021
:incoming_envelope: Simple email interface across multiple service providers (ses, postmark, mandrill, smtp)

go-mail Lightweight email package with multi-provider support (ses, mandrill, postmark) Table of Contents Installation Documentation Examples & Tests

MrZ 39 May 19, 2022
Robust and flexible email library for Go

email Robust and flexible email library for Go Email for humans The email package is designed to be simple to use, but flexible enough so as not to be

Jordan Wright 2.1k Jun 28, 2022
Monitoring and automation for Open Source email servers, starting with Postfix.

Welcome to Lightmeter Control Center, the Open Source mailops monitoring application.

Lightmeter 86 Jun 16, 2022
:white_check_mark: A Go library for email verification without sending any emails.

email-verifier โœ‰๏ธ A Go library for email verification without sending any emails. Features Email Address Validation: validates if a string contains a

AfterShip Ltd. 478 Jun 26, 2022
An email MIME artist for golang

Marcel is a tool to generate IETF compliant emails in raw MIME format. I mainly use this for generating emails with attachments and sending them via amazon SES. If that's what you're doing too, you may want notifications

David Banham 21 May 19, 2022
EMail Searcher By Golang

GiveMeMail โ–„โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–“ โ–ˆโ–ˆโ–’ โ–ˆโ–ˆโ–“ โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–„ โ–„โ–ˆโ–ˆโ–ˆโ–“โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–„ โ–„โ–ˆโ–ˆโ–ˆโ–“ โ–ˆโ–ˆ โ–ˆโ–ˆโ–“ โ–ˆโ–ˆโ–“ โ–ˆโ–ˆโ–’ โ–€โ–ˆโ–’ โ–“โ–ˆโ–ˆโ–’ โ–“โ–ˆโ–ˆโ–‘ โ–ˆโ–’ โ–“โ–ˆ โ–€ โ–“โ–ˆโ–ˆโ–’โ–€โ–ˆโ–€ โ–ˆโ–ˆโ–’โ–“โ–ˆ

ConsT27 10 Dec 4, 2021
โœ‰๏ธ A Go library for email verification without sending any emails.

email-verifier โœ‰๏ธ A Go library for email verification without sending any emails. Features Email Address Validation: validates if a string contains a

AfterShip Ltd. 248 Jun 24, 2021
End-to-end encrypted email for the mesh networking age

Yggmail It's email, but not as you know it. Introduction Yggmail is a single-binary all-in-one mail transfer agent which sends and receives email nati

Neil Alexander 76 Jun 13, 2022
envio de email via SMTP com anexo usando Go

gosendmail - SMTP This repo is a simple net/smtp abstraction for sending emails using SMTP. With it we can send emails With copy, with blind copy and

Jefferson Otoni Lima 8 Dec 16, 2021
Go implementation of the JWZ email threading algorithm

The JWZ Threading algorithm written in Go This is an open source Go implementation of the widely known JWZ message threading algorithm originally writ

GatherStars 21 Jun 7, 2022
Experimental email attachment downloader for Kobo devices (gmail only ATM)

KoboMail Experimental email attachment downloader for Kobo devices (gmail only ATM) What is KoboMail? It is a software that will read emails sent to u

Carlos Lisboa 11 May 10, 2022
In this project I just created email-verification Code.

mail-verification In this project I just created email-verification Code. Setup Before run the program. Type go mod tidy on terminal. After that chang

Ali 1 Nov 4, 2021