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

2015-08-25 0 288
Go语言smtp模块发纯文本文件
    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)  
    }  

遇见资源网 golang Go语言smtp模块发纯文本文件 http://www.ox520.com/13616.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务