Parcourir la source

first commit - generatore di mail

Mauro il y a 2 mois
commit
f7a3c40c50
3 fichiers modifiés avec 39 ajouts et 0 suppressions
  1. 7 0
      go.mod
  2. 4 0
      go.sum
  3. 28 0
      mail.go

+ 7 - 0
go.mod

@@ -0,0 +1,7 @@
+module mail
+
+go 1.23.4
+
+require gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
+
+require gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect

+ 4 - 0
go.sum

@@ -0,0 +1,4 @@
+gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
+gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
+gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
+gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=

+ 28 - 0
mail.go

@@ -0,0 +1,28 @@
+package main
+import( 
+  //"crypto/tls"
+  "gopkg.in/gomail.v2"
+)
+func main() {
+var _from string = "acliservice@altemica.local"
+var _to string = "server@altemica.net"
+var _subject string ="Acliserver in avvio..."
+var _body string ="Acliserver in avvio..."
+
+
+  m := gomail.NewMessage()
+  m.SetHeader("From",_from)
+  m.SetHeader("To",_to)
+  m.SetHeader("Subject",_subject)
+  m.SetBody("Text/Text",_body)
+
+  d := gomail.NewDialer("mail.altemica.net",465,"acliservice@altemica.local","uei551hex")
+  d.SSL=true
+  //d.TLSConfig = &tls.Config{InsecureSkipVerify: true}
+
+// Send the email to Bob, Cora and Dan.
+if err := d.DialAndSend(m); err != nil {
+	panic(err)
+}
+
+}