-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmain.go
More file actions
29 lines (24 loc) · 733 Bytes
/
main.go
File metadata and controls
29 lines (24 loc) · 733 Bytes
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
package main
func main() {
sender := NewSender("<YOUR EMAIL ADDRESS>", "<YOUR EMAIL PASSWORD>")
//The receiver needs to be in slice as the receive supports multiple receiver
Receiver := []string{"abc@gmail.com", "xyz@gmail.com", "larrypage@googlemail.com"}
Subject := "Testing HTLML Email from golang"
message := `
<!DOCTYPE HTML PULBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html"; charset=ISO-8859-1">
</head>
<body>This is the body<br>
<div class="moz-signature"><i><br>
<br>
Regards<br>
Alex<br>
<i></div>
</body>
</html>
`
bodyMessage := sender.WriteHTMLEmail(Receiver, Subject, message)
sender.SendMail(Receiver, Subject, bodyMessage)
}