The email functionality of backup.ps1 fails on my Windows 11 install of restic-windows-backup. The error log shows the following:
Send-MailMessage : Unable to read data from the transport connection: net_io_connectionclosed.
At C:\restic\backup.ps1:337 char:9
+ Send-MailMessage @ResticEmailConfig -From $ResticEmailFrom -T ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpExcept
ion
+ FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage
[[Email]] Sending email completed with errors
Per the documentation of the Send-MailMessage cmdlet, Send-MailMessage is obsolete and has been deprecated in favor of the Send-MailKitMessage cmdlet available in PSGallery. I have fixed this in my own installation of restic-windows-backup by
Adding code to install.ps1 to install the Send-MailKitMessage module
Fjxing the Send-Email function to use Send-MailKitMessage in place of Send-MailMessage.
I will make my changes available in a pull request so that this change can be part of the next release of restic-windows-backup if that is wanted.
The failure occurs on my system running Windows 11 Pro 23H2. I don't know if it occurs on any earlier versions of Windows 11 or Windows 10. By the same token I don't know if my fix works on any other Windows version either. I would be willing to test other platforms (by spinning up VMs for each platform that needs testing) if that would be helpful.
The email functionality of backup.ps1 fails on my Windows 11 install of restic-windows-backup. The error log shows the following:
Per the documentation of the Send-MailMessage cmdlet, Send-MailMessage is obsolete and has been deprecated in favor of the Send-MailKitMessage cmdlet available in PSGallery. I have fixed this in my own installation of restic-windows-backup by
I will make my changes available in a pull request so that this change can be part of the next release of restic-windows-backup if that is wanted.
The failure occurs on my system running Windows 11 Pro 23H2. I don't know if it occurs on any earlier versions of Windows 11 or Windows 10. By the same token I don't know if my fix works on any other Windows version either. I would be willing to test other platforms (by spinning up VMs for each platform that needs testing) if that would be helpful.