csmtp

package module
v0.0.0-...-e0ac040 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2017 License: MIT Imports: 6 Imported by: 1

README

CSMTP

example code:


	csmtp.Host = Settings.SMTP.Host
	csmtp.Port = Settings.SMTP.Port
	csmtp.Name = Settings.SMTP.SenderName
	csmtp.From = Settings.SMTP.SenderEmail
	csmtp.Auth(Settings.SMTP.SenderPassword)

	subject := "测试主题"
	body := "我是一封电子邮件!golang发出."

	err := csmtp.SendMail(subject, body, toEmail)
	if err != nil {
		log.Fatal(err)
	} else {
		log.Print("send OK")
	}

Documentation

Overview

referers:

https://gist.github.com/chrisgillis/10888032
http://www.oschina.net/code/snippet_166520_34694

Index

Constants

This section is empty.

Variables

View Source
var (
	Host string
	Port int    = 465
	Name string // sender name
	From string // sender email

)

only one smtp account for now

Functions

func Auth

func Auth(password string)

Auth setup sender password

func SendMail

func SendMail(subject, body string, to ...string) (err error)

SendMail send a email

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL