So I just spent the past few days upgrading from 3.0.3.2 to 4.0.2.2. Took me 4 days to figure out the email. DNS was the issue.
First: Opencart config
Mail
host: tls://
email@domain.com
Username: your email
Password: your email password
port 587
thank make sure your DNS has:
the proper NS ALL 1 Hour (for Google Workspace it is the following)
ALT1.ASPMX.L.GOOGLE.COM
ALT2.ASPMX.L.GOOGLE.COM
ALT3.ASPMX.L.GOOGLE.COM
ALT4.ASPMX.L.GOOGLE.COM
ASPMX.L.GOOGLE.COM
smtp.google.com
Than make the A Record
localhost 127.0.0.1 30 seconds
domain.com <YOUR SERVER IP> 30 seconds
mail.YOURDOMAIN.com <YOUR SERVER IP> 30 seconds
and CNAME
webmail.<YOURDOMAINNAME>.com
Finally TXT record
YOUR DOMAIN. v=spf1 ip4:<YOUR IP4 ADDRESS> +a +mx +ip4:<YOUR IP4 ADDRESS> +include:relay.mailchannels.net +include:websitewelcome.com ~all
This should fix your email issue.