I'm new with the dotnetzip, it has been very easy and helpful. But I've encountered a problem and I'm not sure if it's related to the dotnetzip, to net.mail or I'm missing something.
The thing is I email a weekly report in an Excel sheet, for security reasons now it has to be encrypted and protected with a password.
This is how I do it:
Dim objZIP As ZipFile = New ZipFile()
Dim ms As MemoryStream = New MemoryStream
objZIP.Password = "PASSWORD!"
objZIP.Encryption = EncryptionAlgorithm.WinZipAes256
objZIP.AddEntry("newfile.xls", "", strXLSReport)
Dim emailMessage As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage
Dim ExcelZip As New System.Net.Mail.Attachment(ms, "attachZip.zip", Net.Mime.MediaTypeNames.Application.Zip)
The email that I receive when executing this doesn't contain anything, and when I say anything I don't only mean the attachment, also recipient, subject, sender and body dissapear.
If I remove the password assignment, it works perfect. I receive the email with all data and the attachment.
I've also tried to save the protected zip to a folder (this worked perfect) and then attach and email it (in this case, the result was the same as using memorystream).
I've made other tests such as changing encryption or the type of the zipped file, but all had the same ending.
Any help or tips will be appreciated, thanks in advance!