Got testing email when run below command.
Send-MailMessage -To outside user mailbox -from your tenant user mailbox -Subject 'Test message' -smtpserver smtp.office365.com -usessl -Credential $cred -Port 587 （Set the sender to the user mailbox for SMTP）
So refer to https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-de...
and tried to setup SMTP relay for application devices to send email to external domain like Yahoo/Gmail but failed.
Already ran the permission amendment command:
Set-ReceiveConnector <> -PermissionGroups AnonymousUsers
Get-ReceiveConnector <> | Add-ADPermission -User "NT AUTHORITY\ANONYMOUS LOGON" -ExtendedRights "Ms-Exch-SMTP-Accept-Any-Recipient"
Current status is telnet from application device can got message like "Sender OK", "Recipient OK", "1583 bytes in 2.814,0.549 KB/sec Queued mail for delivery" when rcpt to: xxx@externaldomain but the email haven't send out and message log not found the transaction.
How to trace it?
Thank you for advice.