This commit is contained in:
Bel LaPointe
2023-04-10 11:00:22 -06:00
parent f850c567ed
commit 4b1b194000
11 changed files with 27 additions and 27 deletions

30
email_test.go Executable file
View File

@@ -0,0 +1,30 @@
package contact
import (
"encoding/json"
"strings"
"testing"
)
func TestEmailer(t *testing.T) {
e := &Emailer{
From: "breellocaldev@gmail.com",
SMTP: "smtp.gmail.com:587",
POP3: "pop.gmail.com:995",
IMAP: "imap.gmail.com:993",
Password: "lhnjijrvqaesiufp",
}
emails, err := e.Read()
if err != nil {
t.Fatal(err)
}
for email := range emails {
if strings.Contains(email.Header["From"][0], "Chase") {
b, _ := json.MarshalIndent(email.Header, "", " ")
t.Logf("%+v, %s", email, b)
}
}
//func (e *Emailer) Send(to, subj, msg string) error {
//func (e *Emailer) Read() ([]Email, error) {
}