67 lines
2.1 KiB
Go
67 lines
2.1 KiB
Go
|
|
package interfaces
|
||
|
|
|
||
|
|
type EmialConfigDataMailgun struct {
|
||
|
|
ApiKey string `json:"api_key"` // mailgun api key
|
||
|
|
Domain string `json:"domain"` // mailgun domain
|
||
|
|
Sender string `json:"sender"` // 发件人
|
||
|
|
}
|
||
|
|
|
||
|
|
type EmailConfigDataSmtp struct {
|
||
|
|
Username string `json:"username"` // 邮箱账号
|
||
|
|
Password string `json:"password"` // 授权码
|
||
|
|
Host string `json:"host"` // SMTP 服务器【默认smtpdm.aliyun.com】
|
||
|
|
Port string `json:"port"` // 发信端口
|
||
|
|
ReplyTo string `json:"reply_to"` // 【选填】回复地址
|
||
|
|
// From string `json:"from"` // 【选填】阿里云邮箱发件人
|
||
|
|
}
|
||
|
|
|
||
|
|
type EmailConfigDataAws struct {
|
||
|
|
AccessId string `json:"access_id"` // 亚马逊AccessId
|
||
|
|
AccessSecret string `json:"access_secret"` // 亚马逊AccessSecret
|
||
|
|
Region string `json:"region"` // 亚马逊Region
|
||
|
|
Sender string `json:"sender"` // 亚马逊发件人
|
||
|
|
}
|
||
|
|
|
||
|
|
type EmialConfigDataAliyun struct {
|
||
|
|
AccessId string `json:"access_id"` // 阿里云AccessId
|
||
|
|
AccessKey string `json:"access_key"` // 阿里云AccessKey
|
||
|
|
Endpoint string `json:"endpoint"` // 区域 默认dm.aliyuncs.com
|
||
|
|
AccountName string `json:"account_name"` // 账号名
|
||
|
|
ReplyAddress string `json:"reply_address"` // 邮件回复地址
|
||
|
|
}
|
||
|
|
|
||
|
|
type Message struct {
|
||
|
|
Form string
|
||
|
|
To []string
|
||
|
|
Cc []string
|
||
|
|
Bcc []string
|
||
|
|
Subject string
|
||
|
|
Body string
|
||
|
|
ReplyTo string
|
||
|
|
Attachment []MessageAttachment // 附件
|
||
|
|
}
|
||
|
|
|
||
|
|
type MessageAttachment struct {
|
||
|
|
Content string
|
||
|
|
ContentType string
|
||
|
|
}
|
||
|
|
|
||
|
|
type EmailSendRecord struct {
|
||
|
|
AccountName string // 发件人
|
||
|
|
UpdateTime int64 // 毫秒时间戳
|
||
|
|
Status EmailSendStatus // 状态
|
||
|
|
ToUser string // 收件人
|
||
|
|
Subject string // 邮件主题
|
||
|
|
ErrorMessage string // 错误信息
|
||
|
|
}
|
||
|
|
|
||
|
|
type EmailSendStatus int
|
||
|
|
|
||
|
|
const (
|
||
|
|
EmailSendStatusUnknown EmailSendStatus = 0
|
||
|
|
EmailSendStatusSuccess EmailSendStatus = 1
|
||
|
|
EmailSendStatusInvalidAddress EmailSendStatus = 2
|
||
|
|
EmailSendStatusSpam EmailSendStatus = 3
|
||
|
|
EmailSendStatusFailed EmailSendStatus = 4
|
||
|
|
)
|