I use gomail to test my routine work, but also encounter the 'unencrypted' problem, so I check both the gomail and golang SMTP source code and found a hack solution. The SMTP.Auth has only one implementation, that is, the plainAuth, so I reimplement the interface as a new type 'FakeEncryptedAuth', but the start() method in new implementation does not check the server'TLS, so it bypasses the check(and the check panic if server'TLS is false, that's why panic when I want to send email via plaintext transport). And in new implementation, We can choose if we bypass the check
my implementation : https://github.com/cgyim1992/gomail.
I use gomail to test my routine work, but also encounter the 'unencrypted' problem, so I check both the gomail and golang SMTP source code and found a hack solution. The SMTP.Auth has only one implementation, that is, the plainAuth, so I reimplement the interface as a new type 'FakeEncryptedAuth', but the start() method in new implementation does not check the server'TLS, so it bypasses the check(and the check panic if server'TLS is false, that's why panic when I want to send email via plaintext transport). And in new implementation, We can choose if we bypass the check my implementation : https://github.com/cgyim1992/gomail.