跳至主要内容

博文

目前显示的是标签为“smtp”的博文

go smtp mail

package  main import  (      "fmt"      "net/smtp"      "strings" ) func   SendToMail (user, password, host, to, subject, body, mailtype  string )  error  {      hp  := strings. Split (host,  ":" )      auth  := smtp. PlainAuth ( "" , user, password, hp[ 0 ])      var   content_type   string      if  mailtype ==  "html"  {          content_type  =  "Content-Type: text/"  + mailtype +  "; charset=UTF-8"     }  else  {          content_type  =  "Content-Type: text/plain"  +  "; charset=UTF-8"     ...