Reset SMTP auth when setting SMTP auth type

This change ensures that the smtpAuth field is reset to nil whenever the SMTP auth type is updated. This prevents potential issues with mismatched authentication settings.
This commit is contained in:
Winni Neessen 2024-10-01 20:44:50 +02:00
parent f823112a4d
commit 986a988c5d
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -578,6 +578,7 @@ func (c *Client) SetPassword(password string) {
// SetSMTPAuth overrides the current SMTP AUTH type setting with the given value
func (c *Client) SetSMTPAuth(authtype SMTPAuthType) {
c.smtpAuthType = authtype
c.smtpAuth = nil
}
// SetSMTPAuthCustom overrides the current SMTP AUTH setting with the given custom smtp.Auth