question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Email To Disk Error

See original GitHub issue

I am using a very basic version with the call: var email = Email .From("support@myemail.com") .To("support@myemail.com") .Subject("Errors founds in " + _context.LocationName) .Body(strMyText, false).Send();

This is my setup in my Startup.cs file: services.AddFluentEmail("support@bear.systems").AddSmtpSender("localhost", 25);

Whenever I send the file, I am getting the following error: The specified path is invalid : '\\2018-11-29_09-17-50_163' at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at FluentEmail.Core.Defaults.SaveToDiskSender.SaveEmailToDisk(IFluentEmail email) at FluentEmail.Core.Defaults.SaveToDiskSender.SendAsync(IFluentEmail email, Nullable1 token) at FluentEmail.Core.Defaults.SaveToDiskSender.Send(IFluentEmail email, Nullable1 token) at FluentEmail.Core.Email.Send(Nullable1 token)`

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:13

github_iconTop GitHub Comments

10reactions
remi0411commented, Oct 9, 2020

Just don’t use static class “Email” on your controler, but use an instance of “IFluentEmail” via DI.

Then use

await emailService .To(recipient, “bob”) .Subject(“hows it going bob”) .Body(“yo bob, long time no see!”) .SendAsync();

And it will work 😃

5reactions
bearsystemscommented, Nov 29, 2018

I figured it out - I added the follwoing:

Email.DefaultSender = new SmtpSender(new System.Net.Mail.SmtpClient() { Host = “localhost”, Port = 25 });

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Outlook For Mac Error: 'Unable To Save ...
"Unable to Save Message to Disk" is the Outlook For Mac Error. Read this post to learn why it pops up and how...
Read more >
Unable to Save Message to Disk Mac Outlook Error [Fix It ...
Unable to Save Message to Disk is the name of an error for Outlook on Mac. Read this post to learn why it...
Read more >
Error occurs when you send or receive an email message ...
In the Named box, type Sent Items.dbx. In the Look In box, click your primary hard disk (usually drive C), and then click...
Read more >
Outlook for mac "unable to save message to disk" error
I'm running the latest Outlook for Mac, version 16.65, and the latest OS for mac Monterey Version 12.4. My mac mini is the...
Read more >
Cannot save outlook message file to disc - "You don't have ...
When trying to save emails to disc as Outlook Message Format, I receive an error message "You don't have the appropriate permission to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found