Skip to content

Commit

Permalink
fix: Email.AttachFromFilename does not dispose stream
Browse files Browse the repository at this point in the history
closes #23
  • Loading branch information
JohnCampionJr committed Sep 9, 2024
1 parent 8a24d6d commit 87441ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FluentEmail.Core/Email.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ public IFluentEmail Attach(IEnumerable<Attachment> attachments)

public IFluentEmail AttachFromFilename(string filename, string contentType = null, string attachmentName = null)
{
var stream = File.OpenRead(filename);
var stream = new MemoryStream(File.ReadAllBytes(filename));
Attach(new Attachment
{
Data = stream,
Expand Down

0 comments on commit 87441ae

Please sign in to comment.