Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
Check the SMTP server configuration: check the SMTP server address, port, and encryption method (TLS/SSL) required by your provider. Common ports are 25, 465 (SSL), or 587 (TLS).
See that your VM's firewall or network security group allows outbound traffic on the SMTP port (e.g., 25, 465, or 587). Check if any antivirus or security software on the VM is blocking SMTP traffic.
Check if your DNS configuration is correct, if you are sending emails from a custom domain. If you're using a third-party SMTP relay service, ensure that the service is active and that your account is properly configured.
Could you please provide the error message you are seeing, which can provide clues about the root cause.
If you have any further queries, do let us know. If the information is helpful, please click Upvote to let us know.