I'm new to nopCommerce and no matter how much I've tried I still haven't got the email sending to work on my 4.30 nopCommerce website that is hosted on an Azure VM. I have done the setup just like the instructions of nopCommerce documentation. I have used the following configuration for the email:
Email address [email protected]
Email display name: DisplayName
Host: smtp.gmail.com
Port: 587
User: [email protected]
Password: <password>
SSL: <checked>
Use default credentials:<NOT checked>
Then I get this error:
An error occurred while attempting to establish an SSL or TLS connection. This usually means that the SSL certificate presented by the server is not trusted by the system for one or more of the following reasons: 1. The server is using a self-signed certificate which cannot be verified. 2. The local system is missing a Root or Intermediate certificate needed to verify the server's certificate. 3. A Certificate Authority CRL server for one or more of the certificates in the chain is temporarily unavailable. 4. The certificate presented by the server is expired or invalid. Another possibility is that you are trying to connect to a port which does not support SSL/TLS. It is also possible that the set of SSL/TLS protocols supported by the client and server do not match. See https://github.com/jstedfast/MailKit/blob/master/FAQ.md#SslHandshakeException for possible solutions.
The SSL I'm using is an SSL I got from Win-acme (I guess self-signed) that expires in 3 months.
If I uncheck the SSL, I get:
535: 5.7.8 Username and Password not accepted.
And in the logs I get (Even though the username and password I'm using is correct):
Nop.Core.NopException: 535: 5.7.8 Username and Password not accepted. Learn more at
5.7.8 https://support.google.com/mail/?p=BadCredentials c18sm7025689wrx.63 - gsmtp
---> MailKit.Security.AuthenticationException: 535: 5.7.8 Username and Password not accepted. Learn more at
5.7.8 https://support.google.com/mail/?p=BadCredentials c18sm7025689wrx.63 - gsmtp
---> MailKit.Net.Smtp.SmtpCommandException: 5.7.8 Username and Password not accepted. Learn more at
5.7.8 https://support.google.com/mail/?p=BadCredentials c18sm7025689wrx.63 - gsmtp
--- End of inner exception stack trace ---
at MailKit.Net.Smtp.SmtpClient.AuthenticateAsync(Encoding encoding, ICredentials credentials, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.Authenticate(Encoding encoding, ICredentials credentials, CancellationToken cancellationToken)
at Nop.Services.Messages.SmtpBuilder.Build(EmailAccount emailAccount) in D:\a\1\s\src\Libraries\Nop.Services\Messages\SmtpBuilder.cs:line 74
--- End of inner exception stack trace ---
at Nop.Services.Messages.SmtpBuilder.Build(EmailAccount emailAccount) in D:\a\1\s\src\Libraries\Nop.Services\Messages\SmtpBuilder.cs:line 74
at Nop.Services.Messages.EmailSender.SendEmail(EmailAccount emailAccount, String subject, String body, String fromAddress, String fromName, String toAddress, String toName, String replyTo, String replyToName, IEnumerable`1 bcc, IEnumerable`1 cc, String attachmentFilePath, String attachmentFileName, Int32 attachedDownloadId, IDictionary`2 headers) in D:\a\1\s\src\Libraries\Nop.Services\Messages\EmailSender.cs:line 196
at Nop.Services.Messages.QueuedMessagesSendTask.Execute() in D:\a\1\s\src\Libraries\Nop.Services\Messages\QueuedMessagesSendTask.cs:line 57
I checked my Gmail's Two-factor Authentication setting and it's turned off.
I don't have many ideas left what to do so your help is much appreciated.