Send an email from one person to another person using PowerShell

Configurare noua (How To)

Situatie

This example sends an email message from one person to another person. The From, To, and Subject parameters are required by Send-MailMessage. This example uses the default $PSEmailServer variable for the SMTP server, so the SmtpServer parameter is not needed.

Solutie

Run the PowerShell command:

Send-MailMessage -From ‘User01 <user01@test.com>’ -To ‘User02 <user02@test.com>’ -Subject ‘Test mail’

The Send-MailMessage cmdlet uses the From parameter to specify the message’s sender. The To parameter specifies the message’s recipient.The Subject parameter uses the text string Test mail as the message because the optional Body parameter is not included.

Tip solutie

Permanent

Voteaza

(8 din 14 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?