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

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

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