Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support socks proxy? #61

Closed
DeadNumbers opened this issue Jun 16, 2016 · 3 comments
Closed

Support socks proxy? #61

DeadNumbers opened this issue Jun 16, 2016 · 3 comments

Comments

@DeadNumbers
Copy link

Hi!
My proxy server as 10.0.2.251 (squid).
Users as 10.0.0.*
If user send without proxy, connect failed. How i can use gomail with proxy? Sorry for my bad english.

@yonnic
Copy link

yonnic commented Sep 25, 2019

i also saw no way to use a proxy.
Any transport hook ?

@pedromorgan
Copy link

see #104 and #108

@DeadNumbers
Copy link
Author

@yonnic

		mail.NetDialTimeout = func(network string, address string, timeout time.Duration) (net.Conn, error) {
			dial, err := proxy.SOCKS5("tcp", socks, nil, proxy.Direct)
			if err != nil {
				return nil, err
			}
			return dial.Dial("tcp", smtp_host.(string))
		}
		err = dial.DialAndSend(msg)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants