Skip to content

SmtpBuilder: does not support non SSL/TLS connection? #5574

@nextfool

Description

@nextfool

nopCommerce version: 4.40.2

Steps to reproduce the problem:

    try
            {
                await client.ConnectAsync(
                    emailAccount.Host,
                    emailAccount.Port,
                    emailAccount.EnableSsl ? SecureSocketOptions.SslOnConnect : SecureSocketOptions.**StartTlsWhenAvailable**);

                if (emailAccount.UseDefaultCredentials)
                {
                    await client.AuthenticateAsync(CredentialCache.DefaultNetworkCredentials);
                } 
                else if (!string.IsNullOrWhiteSpace(emailAccount.Username))
                {
                    await client.AuthenticateAsync(new NetworkCredential(emailAccount.Username, emailAccount.Password));
                }

                return client;
            }

So in the email account settings if we left "Enable SSL" unchecked, as you can see it still fallback to TLS connection?
Isn't it suppose to be SecureSocketOptions.None here if we don't want any authentication here?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions