mail

package
v0.0.0-...-7253f33 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mail 发送短信

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	// 检查验证码
	Send(email Email, config map[string]string) bool
}

type Email

type Email struct {
	From    From
	To      []string
	Bcc     []string
	Cc      []string
	Subject string
	Text    []byte // Plaintext message (optional)
	HTML    []byte // Html message (optional)
}

type From

type From struct {
	Address string
	Name    string
}

type Mailer

type Mailer struct {
	Driver Driver
}

func NewMailer

func NewMailer() *Mailer

NewMailer 单例模式获取

func (*Mailer) Send

func (mailer *Mailer) Send(email Email) bool

type SMTP

type SMTP struct{}

SMTP 实现 email.Driver interface

func (*SMTP) Send

func (s *SMTP) Send(email Email, config map[string]string) bool

Send 实现 email.Driver interface 的 Send 方法

Jump to

Keyboard shortcuts

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