Email - Emailing with limitator for golang

email

Emailing with optional limiter. It will send no more then limiterMax emails during limiterPeriod.

Install

go get github.com/kaibox-git/email

Usage

host := `localhost:25`
// Only 20 emails per 30 minutes. The rest is ignored.
// This is useful for notifications of errors, but has a limitation if emailing is too often.
// In this case send info to log file.
emailNumber := 20 
period := 30 * time.Minute
emailSender, err := email.New(host, emailNumber, period)
if err != nil {
    println(err.Error())
    os.Exit(1)
}

// plain text with limiter
emailSender.Send(&email.Data{
    ContentType: `plain`,
    From: mail.Address{
        Name: `Robot`,
        Address: `[email protected]`,
    },
    To: []mail.Address{
            {
                Name: `Test address`,
                Address: `[email protected]`,
            },
        },
    Subject: `test subject`,
    Body:    `test message`,
    WithLimiter: true,
})

// html body for 2 addresses with no limiter
emailSender.Send(&email.Data{
    ContentType: `html`,
    From: mail.Address{
        Name: `Robot`,
        Address: `[email protected]`,
    },
    To: []mail.Address{
            {
                Name: `Test address`,
                Address: `[email protected]`,
            },
            {
                Name: `Test address 2`,
                Address: `[email protected]`,
            },
        },
    Subject: `test subject`,
    Body:    `<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Emailing HTML format</title>
</head>
<body>
    <h1>Test HTML format</h1>
    <p>This is a test body.</p>
</body>
</html>`,
WithLimiter: false,
})
Similar Resources

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

Dec 30, 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

Dec 30, 2022

:incoming_envelope: Simple email interface across multiple service providers (ses, postmark, mandrill, smtp)

: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

Dec 10, 2022

✉️ 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

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

Jan 2, 2023

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

Aug 18, 2022

Go implementation of the JWZ email threading algorithm

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

Oct 31, 2022

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

Oct 19, 2021

📮 Simple (but useful) email sender written in pure Go v1.17. Support HTML templates and attachments.

📮 Go Email Sender Simple (but useful) email sender written in pure Go v1.17. Yes, yet another email package here! 😅 Support HTML templates and attac

Dec 31, 2021
Related tags
Emailing with optional limiter.

limmail Emailing with optional limiter. It will send no more then limiterMax emails during limiterPeriod. Install go get github.com/kaibox-git/limmail

Jan 5, 2022
Emailing with optional limiter.

lmail Emailing with optional limiter. It will send no more then limiterMax emails during limiterPeriod if you set WithLimiter = true. An emails with W

Jan 6, 2022
VMail - check the markup (HTML, CSS) of HTML email template compatibility with email clients
VMail - check the markup (HTML, CSS) of HTML email template compatibility with email clients

VMail - check the markup (HTML, CSS) of HTML email template compatibility with email clients Email clients use different rendering standards. This is

Dec 17, 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

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

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

Oct 27, 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

Jan 8, 2023
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

Nov 7, 2022
EMail Searcher By Golang
EMail Searcher By Golang

GiveMeMail ▄████ ██▓ ██▒ ██▓ ▓██████ ███▄ ▄███▓▓██████ ███▄ ▄███▓ ██ ██▓ ██▓ ██▒ ▀█▒ ▓██▒ ▓██░ █▒ ▓█ ▀ ▓██▒▀█▀ ██▒▓█

Dec 4, 2021
An email service written in Golang
An email service written in Golang

furion An email service written in Go. Architecture Diagram

Dec 19, 2021
Golang library for sending email using gmail credentials

library for sending email using gmail credentials

Jan 22, 2022