mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-15 02:12:55 +01:00
Update environment variables for SMTP authentication
Renamed environment variables from TEST_USER and TEST_PASS to TEST_SMTPAUTH_USER and TEST_SMTPAUTH_PASS for clarity and consistency in setting SMTP authentication credentials. This change ensures that the correct credentials are applied during tests.
This commit is contained in:
parent
021666d6ad
commit
c2d9104b45
1 changed files with 4 additions and 4 deletions
|
@ -1188,8 +1188,8 @@ func TestClient_DialWithContext_switchAuth(t *testing.T) {
|
||||||
|
|
||||||
// We switch to LOGIN auth, which the server supports
|
// We switch to LOGIN auth, which the server supports
|
||||||
client.SetSMTPAuth(SMTPAuthLogin)
|
client.SetSMTPAuth(SMTPAuthLogin)
|
||||||
client.SetUsername(os.Getenv("TEST_USER"))
|
client.SetUsername(os.Getenv("TEST_SMTPAUTH_USER"))
|
||||||
client.SetPassword(os.Getenv("TEST_PASS"))
|
client.SetPassword(os.Getenv("TEST_SMTPAUTH_PASS"))
|
||||||
if err = client.DialWithContext(context.Background()); err != nil {
|
if err = client.DialWithContext(context.Background()); err != nil {
|
||||||
t.Errorf("failed to dial to sending server: %s", err)
|
t.Errorf("failed to dial to sending server: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -1208,8 +1208,8 @@ func TestClient_DialWithContext_switchAuth(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// We switch to CUSTOM by providing PLAIN auth as function - the server supports this
|
// We switch to CUSTOM by providing PLAIN auth as function - the server supports this
|
||||||
client.SetSMTPAuthCustom(smtp.PlainAuth("", os.Getenv("TEST_USER"), os.Getenv("TEST_PASS"),
|
client.SetSMTPAuthCustom(smtp.PlainAuth("", os.Getenv("TEST_SMTPAUTH_USER"),
|
||||||
os.Getenv("TEST_HOST")))
|
os.Getenv("TEST_SMTPAUTH_PASS"), os.Getenv("TEST_HOST")))
|
||||||
if client.smtpAuthType != SMTPAuthCustom {
|
if client.smtpAuthType != SMTPAuthCustom {
|
||||||
t.Errorf("expected auth type to be Custom, got: %s", client.smtpAuthType)
|
t.Errorf("expected auth type to be Custom, got: %s", client.smtpAuthType)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue