Closed moisoiu closed 1 week ago
Hello, any news on this issue?
Hi @moisoiu, thank you for using our library and for reporting the issue. We're currently in process of releasing the new version of library in order to stay up to date with Infobip APIs. We'll let you know when it is released and we will try to tackle this issue directly afterwards.
Kind regards, Luka
Hello @lvukadinovic-ib Thanks for the update would you have a sky estimation by what month we can expect for the new release of the library to appear?
Thanks in advance, Mircea
Hi @moisoiu , we're aiming to have it released within a few weeks.
Kind regards, Luka
Hi @moisoiu, we've released a fix for this issue 3.0.1. You can now provide name and extension for attachment files when using streams other than a FileStream. For this a new class was introduced - FileParameter. Given your use case, the following code should do the trick:
MemoryStream yourMemoryStream = ...
FileParameter attachmentFile= new FileParameter("attachment.zip", yourMemoryStream);
emailApi.SendEmail(
from: "john.smith@somedomain.com",
to: new List<string> {
"jane.doe@somecompany.com"
},
subject: "Email with an attachment",
text: "Sent using Infobip API C# Client",
attachment: new List<FileParameter>
{
attachmentFile
}
);
This should now properly send an email with an "attachment.zip" attachment. I'm marking this as closed. Feel free to reopen the issue if it still persists.
Hello,
Description:
We are trying to attach a zip file to the attachment from MemoryStream but for some reason in the e-mail it shows no_file_name_provided. Version: 2.1.3 Environment : Production Reproducing : Attach an zip file via MemoryStream or with System.Net.Mail.Attachment class and it won't add the type and the name.
Good to know: If I download the "no_file_name_provided" and add an extension .zip I can access the resource.
I'm guessing it might be because of the Stream which is to expect System.Io.Stream and maybe it should expect
Example of code
I've tried even more excentric approach, but still no success.
Could you please help us out what we are missing ?
Later edit:
After digging a bit more in the Source Code I saw this code
Can there be an extension method for StreamContent ? This would solve all the cases and give the developers flexibility regarding what they want to sent, because I think there are developers that are using In Memory file generation instead of saving on the server.
Thanks, Mircea