Hi @AMITGUY ,
Agree with Andreas that you can try using Send-MailMessage
. Below is a sample script for reference:
Note that you'll need to enable SMTP AUTH in your tenant up front for this to work.
$username = "user@domain.com"
$password = "userpassword"
$sstr = ConvertTo-SecureString -string $password -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential -argumentlist $username, $sstr
$body = "This is a test email"
Send-MailMessage -To "recipient@contoso.com" -From "user@domain.com" -Subject 'Test message' -Body $body -BodyAsHtml -smtpserver smtp.office365.com -usessl -Credential $cred -Port 587
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.