Search code examples
goproxysmtp

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


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.


Solution

  • 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. )