smtp

package
v0.0.0-...-d0a0e58 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const Server = "https://api.mysubmail.com"

Variables

This section is empty.

Functions

func CreateSignature

func CreateSignature(request map[string]string, config map[string]string) string

func Get

func Get(requesturl string) string

func GetTimestamp

func GetTimestamp() string

func MultipartPost

func MultipartPost(requesturl string, postdata map[string]string) string

func Post

func Post(requesturl string, postdata map[string]string) string

func SendMailBySmtp

func SendMailBySmtp(smtpMail *SmtpMail) error

Types

type BasicMailClient

type BasicMailClient struct {
	Name string

	// set your account
	User      string
	Password  string
	Host      string
	UserAlias string
	// contains filtered or unexported fields
}

func (*BasicMailClient) GetName

func (c *BasicMailClient) GetName() string

func (*BasicMailClient) Send

func (c *BasicMailClient) Send(subject, content string, toAddress string) error

type MailClient

type MailClient interface {
	GetName() string
	Send(subject, content string, toAddress string) error
}

type SaiyouMailClient

type SaiyouMailClient struct {
	Name string

	// Set your own key pair
	Appid    string
	Appkey   string
	SignType string
	// contains filtered or unexported fields
}

func (*SaiyouMailClient) GetName

func (c *SaiyouMailClient) GetName() string

func (*SaiyouMailClient) Send

func (c *SaiyouMailClient) Send(subject, content string, toAddress string) error

type SaiyouMailSend

type SaiyouMailSend struct {
	// contains filtered or unexported fields
}

func CreateSaiyouMailSender

func CreateSaiyouMailSender(config map[string]string) *SaiyouMailSend

func (*SaiyouMailSend) AddAttachments

func (this *SaiyouMailSend) AddAttachments(file string)

func (*SaiyouMailSend) AddBcc

func (this *SaiyouMailSend) AddBcc(address string)

func (*SaiyouMailSend) AddCc

func (this *SaiyouMailSend) AddCc(address string)

func (*SaiyouMailSend) AddHeaders

func (this *SaiyouMailSend) AddHeaders(key string, val string)
func (this *SaiyouMailSend) AddLink(key string, val string)

func (*SaiyouMailSend) AddTo

func (this *SaiyouMailSend) AddTo(address string, name string)

func (*SaiyouMailSend) AddVar

func (this *SaiyouMailSend) AddVar(key string, val string)

func (*SaiyouMailSend) Send

func (this *SaiyouMailSend) Send() string

func (*SaiyouMailSend) SetAsynchronous

func (this *SaiyouMailSend) SetAsynchronous(status bool)

func (*SaiyouMailSend) SetHtml

func (this *SaiyouMailSend) SetHtml(html string)

func (*SaiyouMailSend) SetReply

func (this *SaiyouMailSend) SetReply(address string)

func (*SaiyouMailSend) SetSender

func (this *SaiyouMailSend) SetSender(address string, name string)

func (*SaiyouMailSend) SetSubject

func (this *SaiyouMailSend) SetSubject(subject string)

func (*SaiyouMailSend) SetTag

func (this *SaiyouMailSend) SetTag(tag string)

func (*SaiyouMailSend) SetText

func (this *SaiyouMailSend) SetText(text string)

type SaiyouResp

type SaiyouResp struct {
	Status string `json:"status"`
	Code   int    `json:"code"`
	Msg    string `json:"msg"`
}

type SendCloudMailClient

type SendCloudMailClient struct {
	Name string

	// Set your key information
	ApiUser  string
	ApiKey   string
	Host     string
	Port     string
	From     string
	FromName string
	// contains filtered or unexported fields
}

func (*SendCloudMailClient) GetName

func (c *SendCloudMailClient) GetName() string

func (*SendCloudMailClient) Send

func (c *SendCloudMailClient) Send(subject, content string, toAddress string) error

func (*SendCloudMailClient) SendVCodeMailBySendCloundImplementation

func (c *SendCloudMailClient) SendVCodeMailBySendCloundImplementation(mailTo []string, subject string, body string) error

type SmtpMail

type SmtpMail struct {
	Host      string
	User      string
	Password  string
	UserAlias string

	To          string
	Subject     string
	Content     string
	ContentType string
}

Jump to

Keyboard shortcuts

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