Quantcast
Channel: Veeam Support Knowledge Base
Viewing all articles
Browse latest Browse all 4362

How to Send a Test Email Notification Using PowerShell

$
0
0

How to Send a Test Email Notification Using PowerShell

KB ID: 4472
Product: Veeam Backup & Replication
Published: 2023-07-19
Last Modified: 2023-07-19

Purpose

This article documents a method for sending a simple email via PowerShell.

Use Case

Email notifications are failing to be sent by Veeam Backup & Replication, and there is a need to test the capability to send emails outside of Veeam Backup & Replication from the Veeam Backup Server.

Solution

Update and run the following PowerShell script on the Veeam Backup Server to simulate sending an email in a manner similar to the way Veeam Backup & Replication sends a notification email when using an SMTP server (Basic Authentication).
Send-MailMessage -From <FromEmail> -To <ToEmail> -Subject "Veeam Powershell Email Test" -Body "Testing the SMTP service from PowerShell" -SmtpServer <smtp_server> -Credential (Get-Credential) -UseSsl -Port <port>

Notes:

  • When the command is executed, a pop-up requesting the SMTP credentials will appear.
    If credentials are not required, remove this paramter from the command: -Credential (Get-Credential)
credreq
  • The following values must be updated in the command above:
    • <FromEmail>
    • <ToEmail>
    • <smtp_server>
    • <port>
    Example:
    Send-MailMessage -From alerts@domain.tld -To backupadmin@domain.tld -Subject "Veeam Powershell Email Test" -Body "Testing the SMTP service from PowerShell" -SmtpServer smtprelay.domain.tld -Port 25
    
  • Remove -UseSsl if SSL is not enabled in the Veeam Backup & Replication Email Notification settings.

More Information

The Veeam PowerShell cmdlet Get-VBRMailNotificationConfiguration can be used to pull the current email settings from Veeam Backup & Replication.
To submit feedback regarding this article, please click this link: Send Article Feedback
To report a typo on this page, highlight the typo with your mouse and press CTRL + Enter.

Viewing all articles
Browse latest Browse all 4362

Trending Articles