Bird
0
0

Which of the following is the correct syntax to send an email alert with subject 'Alert' and body 'Disk space low' using Send-MailMessage?

easy📝 Syntax Q3 of 15
PowerShell - Automation Patterns
Which of the following is the correct syntax to send an email alert with subject 'Alert' and body 'Disk space low' using Send-MailMessage?
ASend-MailMessage -Recipient 'admin@example.com' -Title 'Alert' -Message 'Disk space low' -Server 'smtp.example.com'
BSend-Mail -To 'admin@example.com' -Subject 'Alert' -Body 'Disk space low' -Server 'smtp.example.com'
CSend-MailMessage -To 'admin@example.com' -Subject 'Alert' -Body 'Disk space low' -SmtpServer 'smtp.example.com'
DSend-EmailMessage -To 'admin@example.com' -Subject 'Alert' -Body 'Disk space low' -Smtp 'smtp.example.com'
Step-by-Step Solution
Solution:
  1. Step 1: Check correct cmdlet and parameters

    Send-MailMessage uses -To, -Subject, -Body, and -SmtpServer parameters.
  2. Step 2: Validate each option's syntax

    Send-MailMessage -To 'admin@example.com' -Subject 'Alert' -Body 'Disk space low' -SmtpServer 'smtp.example.com' matches correct cmdlet and parameters. Others use wrong cmdlet names or parameter names.
  3. Final Answer:

    Send-MailMessage -To 'admin@example.com' -Subject 'Alert' -Body 'Disk space low' -SmtpServer 'smtp.example.com' -> Option C
  4. Quick Check:

    Correct syntax = Send-MailMessage -To 'admin@example.com' -Subject 'Alert' -Body 'Disk space low' -SmtpServer 'smtp.example.com' [OK]
Quick Trick: Use -To, -Subject, -Body, -SmtpServer with Send-MailMessage [OK]
Common Mistakes:
  • Using incorrect cmdlet names like Send-Mail or Send-EmailMessage
  • Wrong parameter names like -Recipient or -Title
  • Omitting -SmtpServer parameter

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes