net/smtp: documentation for how to disable authentication is incorrect #48759
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
At least I assume this is a documentation issue, but I suppose it could also be solved by implementing what is documented.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Tried to send email with smtp.SendMail, with authentication disabled in the way suggested in the documentation for smtp.Auth.
Documentation for the Start function in the smtp.Auth interface states:
So I implemented a noAuth type like this:
This doesn't seem to work, but by skipping this and just sending nil as Auth to smtp.SendMail() it works fine.
The documentation for smtp.SendMail does say that the Auth parameter is optional, but it seems the comment in the Auth interface about returning "" should be removed.
smtp.SendMail seems to only check for nil, and the Auth method for smtp.Client also doesn't care whether an empty mech is returned.
What did you expect to see?
Successfully sent email.
What did you see instead?
SMTP server replies
504 5.7.4 Unrecognized authentication type
The text was updated successfully, but these errors were encountered: