小伙伴们有没有觉得学习golang很有意思?有意思就对了!今天就给大家带来《如何使用 amazon smtp 通过端口 587 发送电子邮件》,以下内容将会涉及到,若是在学习中对其中部分知识点有疑问
小伙伴们有没有觉得学习golang很有意思?有意思就对了!今天就给大家带来《如何使用 amazon smtp 通过端口 587 发送电子邮件》,以下内容将会涉及到,若是在学习中对其中部分知识点有疑问,或许看了本文就能帮到你!
问题内容我想使用 Amazon SMTP 发送电子邮件。
我正在使用示例
https://GISt.GitHub.com/jim3ma/b5c9edeac77ac92157f8f8affa290f45
但不起作用!
我收到此消息错误:
tls:第一个记录看起来不像 TLS 握手 恐慌:tls:第一条记录看起来不像 TLS 握手
尝试使用Https://Golang.org/pkg/net/smtp/#example_SendMail中的代码
package main
import (
"log"
"net/smtp"
)
func main() {
// Set up authentication infORMation.
auth := smtp.PlainAuth("", "[email protected]", "passWord", "mail.example.com")
// Connect to the server, authenticate, set the sender and recipient,
// and send the email all in one step.
to := []string{"[email protected]"}
msg := []byte("To: [email protected]\r\n" +
"Subject: discount Gophers!\r\n" +
"\r\n" +
"This is the email body.\r\n")
err := smtp.SendMail("mail.example.com:25", auth, "[email protected]", to, msg)
if err != nil {
log.Fatal(err)
}
}
终于介绍完啦!小伙伴们,这篇关于《如何使用 amazon smtp 通过端口 587 发送电子邮件》的介绍应该让你收获多多了吧!欢迎大家收藏或分享给更多需要学习的朋友吧~编程网公众号也会发布Golang相关知识,快来关注吧!
--结束END--
本文标题: 如何使用 amazon smtp 通过端口 587 发送电子邮件
本文链接: https://www.lsjlt.com/news/596600.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-04-05
2024-04-05
2024-04-05
2024-04-04
2024-04-05
2024-04-05
2024-04-05
2024-04-05
2024-04-04
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0