The 4.3 development version based on mailkit has an issue sending mails when the SMTP server does not have authentication enabled. I am using Office 365 to send mails, it is configure to authenticate based on source IP address and does not accept authentication. In 4.2 this works fine but the mailkit implementation always tries to authenticate even if no username/password is configured.
To get it working I made the following change in SmtpBuilder:
if (emailAccount.UseDefaultCredentials || !string.IsNullOrWhiteSpace(emailAccount.Username)) { client.Authenticate(emailAccount.UseDefaultCredentials ? CredentialCache.DefaultNetworkCredentials : new NetworkCredential(emailAccount.Username, emailAccount.Password)); }
I am having the same issue testing 4.30, i cant connect to my exchange server but using 4.20 everthing is good. Where on 4.30 source do i need to modify to get it to work? Thank you
I want to try the below, because i also have an issue with the ssl certificate, when SSl is ticked then i get an error about the certificate being empty on the excahange log files.
// if there are errors in the certificate chain, look at each error to determine the cause. if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateChainErrors) != 0) { if (chain != null && chain.ChainStatus != null) { foreach (var status in chain.ChainStatus) { if ((certificate.Subject == certificate.Issuer) && (status.Status == X509ChainStatusFlags.UntrustedRoot)) { // self-signed certificates with an untrusted root are valid. continue; } else if (status.Status != X509ChainStatusFlags.NoError) { // if there are any other errors in the certificate chain, the certificate is invalid, // so the method returns false. return false; } } }
// When processing reaches this line, the only errors in the certificate chain are // untrusted root errors for self-signed certificates. These certificates are valid // for default Exchange server installations, so return true. return true; }
To use this, what all has to be recompiled? Does anyone know offhand which compiled DDL file this will change? Or does the whole project have to be recompiled?
Make the changes Rebuild the Solution Publish the Solution - The only file that should change is Nop.Services.dll Stop webserver Copy this file to production Restart webserver