GithubHelp home page GithubHelp logo

marcel's Introduction

Marcel

PkgGoDev

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

Marcel supports:

  • HTML bodies
  • Text bodies
  • Emails with only an HTML or Text body
  • Attachments
  • JSON serialisation of emails and attachments

Marcel does not support:

  • Inline attachments

Marcel endeavours to pass the IETF Msglint tool with no errors. If you have a payload that generates errors please file an issue.

Example

package main

import (
	"fmt"
	"log"
	"strings"

	"github.com/davidbanham/marcel"
)

func main() {
	mail := marcel.Email{
		To:      "[email protected]",
		From:    "[email protected]",
		ReplyTo: "[email protected]", // optional
		Text:    "This is the important information in text format",
		HTML:    "This is the important information in <b>HTML</b> format",
		Subject: "A really important email",
		Attachments: []marcel.Attachment{
			marcel.Attachment{
				ContentType: "text/plain",
				Data:        strings.NewReader("A very important attachment"), // Data will be base64 encoded before sending
				Filename:    "test_data.txt",
			},
		},
	}

	rawEmail, err := mail.ToMIME()
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(string(rawEmail))
}

marcel's People

Contributors

davidbanham avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.