Step 1: Run Powershell
Step 2: Enter your Office 365 User Details
$msolcred = get-credential
Step 3: Send Mail
Send-MailMessage –From email@example.com –To firstname.lastname@example.org –Subject “Test Email” –Body “Test SMTP Relay Service” -SmtpServer smtp.office365.com -Credential $msolcred -UseSsl -Port 587
Don't forget to replace the required information with your info.
eg: From, To, Subject, Body
Also please note the From address must be the same email address associated with the provided user credentials.