Skip to content

Simple library for sending utf-8 e-mails and attachments via smtp with golang

License

Notifications You must be signed in to change notification settings

ozgur-yalcin/smtp.go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smtp.go

Simple library for sending utf-8 e-mails via smtp with golang

License

The MIT License (MIT). Please see License File for more information.

Installation

go get github.com/ozgur-yalcin/smtp.go

Usage

package main

import (
	"fmt"
	"net/mail"

	smtp "github.com/ozgur-yalcin/smtp.go/src"
)

func main() {
	config := smtp.Config{MailHost: "", MailPort: "", MailUser: "", MailPass: ""}
	api := &smtp.API{Config: config}
	api.SetHeaders(mail.Address{"From Name", "from@example.com"}, mail.Address{"To Name", "to@example.com"}, "Title", "Message")
	send := api.Send()
	if send {
		fmt.Println("SENT!")
	} else {
		fmt.Println("ERROR")
	}
}

About

Simple library for sending utf-8 e-mails and attachments via smtp with golang

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages