在Golang中,使用go-simple-mail库是否有办法使用代理?

huangapple go评论70阅读模式
英文:

Is there any way to use proxy with go-simple-mail lib in Golang?

问题

一个项目使用"github.com/xhit/go-simple-mail/v2"通过smtp发送邮件。

最近被要求在这个库中添加代理的使用,但是无法弄清楚如何做到。

在Google或库本身中找不到示例。(

所以我现在想知道是否可能在这个库中实现,或者我应该使用其他东西代替。

如果使用go-simple-mail可能实现的话,非常感谢提供一个工作示例。

更新:
考虑到迄今为止的评论,决定提供更多信息。

目标是在某些情况下隐藏发件人的IP地址(仅在某些情况下)。这不是一个网络任务。这是我必须在代码中完成的事情。

一般来说,我需要创建一个转发代理,并告诉我的应用在某些情况下使用这个转发代理。但是对于smtp而不是http/https,我可能已经找到了一个允许这样做的库。目前正在检查它。但我想知道是否有一种使用go-simple-mail的方法,因为之前的人使用的就是这个库。

英文:

One project uses "github.com/xhit/go-simple-mail/v2" for sending mail through smtp.

Recently was tasked to add usage of proxy with this lib. But can't figure out how to do it.

Failed to find examples on Google or in lib itself. (

So I wander now if this is even possible with this lib or I should just use something else instead.

If it is possible with go-simple-mail, then working example would be much appreciated.

Update:
Considering comments so far decided to give a bit more info.

The goal is to hide sender IP in some cases(only is some cases). It's not a network task. It's smth I have to do in the code.

Generally speaking I need to tell create forward proxy and tell my app to use this forward proxy in some cases. But for smtp not http/https
I might have found one lib, that allows to do that. Checking it out at the moment. But I wander if there's some way to do it using go-simple-mail, cuz that's what people before me used.

答案1

得分: 0

很遗憾,关闭问题没有其他选项。

@spike014的评论有所帮助。

更新:之后与go-simple-mail的创建者交谈,他允许添加必要的改进。我会尽快完成。目前,我基于go-simple-mail创建了自己的库(许可证和作者允许)。运行得很完美。)

英文:

Sadly there's no other option on closing questions.

Comments from @spike014 helped.

Update: afterwards talked to creator of go-simple-mail and he allowed to add necessary improvement. Will do it shortly. For now created my own lib based on go-simple-mail(License and author allow it). Works perfect. )

huangapple
  • 本文由 发表于 2023年5月19日 16:21:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/76287276.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定