Go语言smtp模块发纯文本文件

2019PHP高薪工程师学习路线图....>>>

    package main  
      
    import (  
        "fmt"  
        "net/smtp"  
    )  
      
    func main() {  
        auth := smtp.PlainAuth("text/plain", "[email protected]", "123456", "smtp.163.com")  
        to := []string{"[email protected]"}  
        msg := []byte(`To:[email protected]  
    From:[email protected]  
    Subject:测试  
    Content-Type: text/plain;  
    charset=UTF-8"  
      
    this is test mail`)  
        err := smtp.SendMail("smtp.163.com:25", auth, "[email protected]", to, msg)  
        fmt.Println(err)  
    }