All Projects → DusanKasan → Parsemail

DusanKasan / Parsemail

Licence: mit
Simple email parsing for Golang

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Parsemail

Python Sparkpost
SparkPost client library for Python
Stars: ✭ 87 (-18.69%)
Mutual labels:  email
Pine
A modular and lightweight, responsive email framework.
Stars: ✭ 98 (-8.41%)
Mutual labels:  email
I2p.i2p Bote
I2P-Bote is a serverless, encrypted e-mail application.
Stars: ✭ 103 (-3.74%)
Mutual labels:  email
Inbrief
InBrief is a personal briefing app and dashboard powered by Electron and React
Stars: ✭ 90 (-15.89%)
Mutual labels:  email
Mailway
Mailway installer, host your own Mailway instance
Stars: ✭ 94 (-12.15%)
Mutual labels:  email
Ravenx
Notification dispatch library for Elixir applications
Stars: ✭ 100 (-6.54%)
Mutual labels:  email
Jaromail
A commandline tool to easily and privately handle your e-mail
Stars: ✭ 86 (-19.63%)
Mutual labels:  email
Django Notifs
Modular Notifications (InApp, Email, SMS, CustomBackend etc) for Django
Stars: ✭ 105 (-1.87%)
Mutual labels:  email
Mailmergelib
MailMergeLib is a mail message client library which provides comfortable mail merge capabilities for text, inline images and attachments, as well as good throughput and fault tolerance for sending mail messages.
Stars: ✭ 97 (-9.35%)
Mutual labels:  email
Mosaico
Mosaico - Responsive Email Template Editor
Stars: ✭ 1,392 (+1200.93%)
Mutual labels:  email
Opaquemail
.NET email library and proxy supporting IMAP, POP3, and SMTP with S/MIME and PGP.
Stars: ✭ 91 (-14.95%)
Mutual labels:  email
Cssinliner Extra
CSS Inliner support for Twig
Stars: ✭ 93 (-13.08%)
Mutual labels:  email
Premailer Rails
CSS styled emails without the hassle.
Stars: ✭ 1,382 (+1191.59%)
Mutual labels:  email
Aws Lambda Ses Forwarder
Serverless email forwarding using AWS Lambda and SES
Stars: ✭ 1,290 (+1105.61%)
Mutual labels:  email
Spring Boot 2.x Examples
Spring Boot 2.x code examples
Stars: ✭ 104 (-2.8%)
Mutual labels:  email
Contextio Node
[DEPRECATED] - Official Node.js client library for the Context.IO Email API
Stars: ✭ 86 (-19.63%)
Mutual labels:  email
Swiftmailer
Comprehensive mailing tools for PHP
Stars: ✭ 9,503 (+8781.31%)
Mutual labels:  email
N1 Unsubscribe
Plugin for Nylas Mail that adds a quick unsubscribe button for email.
Stars: ✭ 105 (-1.87%)
Mutual labels:  email
Rspamd
Rapid spam filtering system.
Stars: ✭ 1,392 (+1200.93%)
Mutual labels:  email
Awesome Emails
✉️ An awesome list of resources to build better emails.
Stars: ✭ 1,379 (+1188.79%)
Mutual labels:  email

Parsemail - simple email parsing Go library

Build Status Coverage Status Go Report Card

This library allows for parsing an email message into a more convenient form than the net/mail provides. Where the net/mail just gives you a map of header fields and a io.Reader of its body, Parsemail allows access to all the standard header fields set in RFC5322, html/text body as well as attachements/embedded content as binary streams with metadata.

Simple usage

You just parse a io.Reader that holds the email data. The returned Email struct contains all the standard email information/headers as public fields.

var reader io.Reader // this reads an email message
email, err := parsemail.Parse(reader) // returns Email struct and error
if err != nil {
    // handle error
}

fmt.Println(email.Subject)
fmt.Println(email.From)
fmt.Println(email.To)
fmt.Println(email.HTMLBody)

Retrieving attachments

Attachments are a easily accessible as Attachment type, containing their mime type, filename and data stream.

var reader io.Reader
email, err := parsemail.Parse(reader)
if err != nil {
    // handle error
}

for _, a := range(email.Attachments) {
    fmt.Println(a.Filename)
    fmt.Println(a.ContentType)
    //and read a.Data
}

Retrieving embedded files

You can access embedded files in the same way you can access attachments. They contain the mime type, data stream and content id that is used to reference them through the email.

var reader io.Reader
email, err := parsemail.Parse(reader)
if err != nil {
    // handle error
}

for _, a := range(email.EmbeddedFiles) {
    fmt.Println(a.CID)
    fmt.Println(a.ContentType)
    //and read a.Data
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].