Golang : dial tcp: too many colons in address
Encounter this error message Golang : dial tcp: too many colons in address ssl://smtp.googlemail.com:465
while working on the transaction email portion today.
After some debugging, found out that Go doesn't like anything more than 1 colon in a string for hostname and password
To fix the problem, just close the string with brackets.
from
smtpHost := "ssl://smtp.googlemail.com"
to
smtpHost := "[ssl://smtp.googlemail.com]"
Basically, when dealing with hostname, password, and dial function. The rule of thumb is
[user:pass@hostname]:portnum
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+5.4k CodeIgniter : form input set_value cause " to become & quot
+20.1k Golang : Upload big file (larger than 100MB) to AWS S3 with multipart upload
+20.4k Golang : Convert seconds to minutes and remainder seconds
+4.5k Golang : Shortening import identifier
+4.2k JavaScript/JQuery : Redirect page examples
+14k Golang : Get digits from integer before and after given position example
+25.1k Golang : Calculate future date with time.Add() function
+3.5k Javascript : How to show different content with noscript?
+5.9k Golang : Levenshtein distance example
+9.4k Golang : Underscore string example
+37.8k Golang : How to iterate over a []string(array)
+11.4k Golang : Exit, terminating or aborting a program