Does anyone have a Powershell script to configure the SMTP server? like:
Go to the Delivery tab.
Then click Outbound Security. Here you specify the way of authentication on the external mail server to which your SMTP server will send (relay) all email messages. For example, if all emails will be forward to Gmail mail server and then sent to the recipients, you need to check the Basic authentication and specify your Gmail mailbox credentials (you must allow to send email via Gmail SMTP in the Google account settings).
Then click Advanced.
Here you specify the FQDN name of your SMTP server. Click the Check DNS button to make sure that the DNS record is valid.
If your server sends mail to an external SMTP server, specify its name in the Smart host field (for example, smtp.gmail.com or smtp.office365.com).
Some public mail servers accept email only when using a secure SMTP connection using TLS Encryption (TCP port 587). You can configure this setting in the section Delivery -> Outbound Security and Outbound Connections. Read the documentation of your email provider.
Save the SMTP server settings and restart your SMTP virtual service to apply the changes.