Send email from Exchange Online with the Microsoft Graph PowerShell SDK

You can use the Send-MailMessage cmdlet to send email with PowerShell. However, its use is not recommended because the SmtpClient class it uses internally is also not recommended. There is no first-party replacement cmdlet, so to send email to an SMTP server, you need to use a third-party module or create your own SMTP email-sending functionality.

If you want to send email from an Exchange Online mailbox rather than through SMTP, you can use Microsoft Graph. The Microsoft Graph PowerShell SDK, a module for using Microsoft Graph with PowerShell, also provides cmdlets for this purpose.

Read more

View all posts