diff --git a/README b/README index a21f810..0b19521 100644 --- a/README +++ b/README @@ -45,7 +45,6 @@ gobyexample.com signups = topics * gzip -* sending email * listing files * regular expressions * json parsing/unparsing @@ -54,7 +53,6 @@ gobyexample.com signups * https server * https client * buffered io -* wait group * tcp proxy * http streaming server * http streaming client diff --git a/src/xx-email.go b/src/xx-email.go new file mode 100644 index 0000000..4c2e433 --- /dev/null +++ b/src/xx-email.go @@ -0,0 +1,26 @@ +package main + +import ( + "net/smtp" +) + +func main() { + auth := smtp.PlainAuth( + "", + "mark@heroku.com", + "xxx", + "smtp.gmail.com", + ) + + err := smtp.SendMail( + "smtp.gmail.com:25", + auth, + "mark+sent@heroku.com", + []string{"mark@heroku.com"}, + []byte("The Subject\r\n\r\nThe Body"), + ) + if err != nil { panic(err) } +} + +// missing subject, cc, bcc, attachements, plain/multi-type emails +// https://github.com/mtoader/google-go-lang-idea-plugin/issues/112