gpt4 book ai didi

go - smtp.Dial ("ASPMX.L.GOOGLE.COM:25") 连接错误;但是腻子连接有效

转载 作者:数据小太阳 更新时间:2023-10-29 03:16:52 32 4
gpt4 key购买 nike

使用 Go 和 smtp.Dial 时,甚至 net.Dial,我收到错误:

dial tcp 64.233.169.27:25: ConnectEx tcp: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

来自这段代码:

mxClient, err := smtp.Dial("ASPMX.L.GOOGLE.COM:25")
if err != nil {
fmt.Println(err)
}

我不明白的是,我可以在没有 TLS 的情况下使用端口 25 上的 putty 连接和发送命令(HELO 等)。如果这是无法建立连接的包的限制,是否有推荐的方法来建立原始套接字连接,例如 Go 中的 putty?

最佳答案

我在我的机器上没有看到任何错误。

package main

import (
"fmt"
"net/smtp"
)

func main() {
mxClient, err := smtp.Dial("ASPMX.L.GOOGLE.COM:25")
if err != nil {
fmt.Println(err)
}
fmt.Printf("%#v", mxClient)
}

给予

&smtp.Client{Text:(*textproto.Conn)(0xc208074000), conn:(*net.TCPConn)(0xc20802c018), tls:false, serverName:"ASPMX.L.GOOGLE.COM", ext:map[string]string(nil), auth:[]string(nil), localName:"localhost", didHello:false, helloError:error(nil)}

关于go - smtp.Dial ("ASPMX.L.GOOGLE.COM:25") 连接错误;但是腻子连接有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30342881/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com