Send-IMTestMessage
SYNOPSIS
Sends a test SMTP message to validate email notification configuration.
SYNTAX
Send-IMTestMessage [[-Session] <ImmichSession>] [[-enabled] <Boolean>] [-from] <String> [-replyto] <String>
[-hostname] <String> [[-ignoreCert] <Boolean>] [-Password] <SecureString> [[-port] <Int32>]
[[-username] <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
The Send-IMTestMessage function sends a test email message using the configured SMTP settings to validate that email notifications are working properly. This is useful for testing SMTP server connectivity, authentication, and configuration before relying on automated notifications from Immich.
The function allows you to specify complete SMTP configuration parameters, including server details, authentication credentials, and message routing information to ensure proper email delivery functionality.
EXAMPLES
EXAMPLE 1
Send-IMTestMessage -Hostname 'smtp.gmail.com' -Port 587 -Username 'user@gmail.com' -From 'immich@example.com'
Sends a test message using Gmail SMTP with TLS encryption.
EXAMPLE 2
Send-IMTestMessage -Hostname 'localhost' -Port 25 -From 'immich@local.domain' -IgnoreCert $true
Sends a test message using a local SMTP server without certificate validation.
EXAMPLE 3
$smtpConfig = @{
Hostname = 'mail.example.com'
Port = 465
Username = 'notifications@example.com'
From = 'immich@example.com'
ReplyTo = 'admin@example.com'
}
Send-IMTestMessage @smtpConfig
Uses splatting to send a test message with comprehensive SMTP configuration.
PARAMETERS
-Session
Optionally define a immich session object to use. This is useful when you are connected to more than one immich instance.
-Session $Session
Type: ImmichSession
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-enabled
Controls whether SMTP functionality is enabled for the test. Defaults to $true. Set to $false to test configuration validation without actually sending mail.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: True
Accept pipeline input: False
Accept wildcard characters: False
-from
Specifies the sender email address that will appear in the 'From' field of the test message. This should be a valid email address that the SMTP server allows as a sender.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-replyto
Specifies the reply-to email address for the test message. When recipients reply to the test message, their responses will be directed to this address.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-hostname
Specifies the hostname or IP address of the SMTP server to use for sending the test message. This should be accessible from the Immich server.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ignoreCert
Controls whether SSL/TLS certificate validation should be skipped when connecting to the SMTP server. Set to $true to bypass certificate validation (useful for self-signed certificates), or $false for strict certificate validation.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Password
Specifies the password for SMTP server authentication. This should be provided as a SecureString for security purposes when authenticating with the SMTP server.
Type: SecureString
Parameter Sets: (All)
Aliases:
Required: True
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-port
Specifies the port number for SMTP server connection. Common values are 25 (plain), 587 (TLS), 465 (SSL), or custom ports as configured by your SMTP provider.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Default value: 25
Accept pipeline input: False
Accept wildcard characters: False
-username
Specifies the username for SMTP server authentication. This is typically an email address or account name required by the SMTP server for authentication.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
NOTES
Use this function to validate SMTP configuration before enabling automated notifications. Successful test messages indicate that the SMTP settings are correct and functional.
RELATED LINKS
EDIT THIS DOC
This page was auto-generated from the powershell command comment based help. To edit the content of this page, update the script file comment based help on github Github