-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefs.go
82 lines (71 loc) · 1.55 KB
/
defs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package gosmtp
const htmlTemplate = `
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
{{.Body}}
</body>
</html>
`
const (
FAILURE = "FAILURE"
DELAY = "DELAY"
SUCCESS = "SUCCESS"
)
type Priority uint8
const (
Highest Priority = 1
High Priority = 2
Normal Priority = 3
Low Priority = 4
Lowest Priority = 5
)
func (p Priority) String() string {
switch p {
case Highest:
return "Highest"
case High:
return "High"
case Normal:
return "Normal"
case Low:
return "Low"
case Lowest:
return "Lowest"
}
return "unknown"
}
type EmailAddr struct {
Name string // Name can be omitted
Address string
}
type MailItem struct {
// email adress of the account used to send email
// (may be the same as the primary email-account)
From EmailAddr
To []EmailAddr
CC []EmailAddr
BCC []EmailAddr
Attachment []string // full path of files to attach
Subject string
HTMLBody string
TextBody string
Priority Priority
Language string
UserAgent string
// DeliveryStatusNotification causes a status email be sent
// to the FROM address.
DeliveryStatusNotification []string
// DispositionNotificationTo is a request for the SMTP server
// to send a DSN (Selivery Status Notification) as soon as the recipient opens the email.
DispositionNotificationTo string
}
type MailCredentials struct {
Host string // IP address or host-name
PortNo int
UserName string // the primary user-name for the smtp account
Password string
}