System.ArgumentException: The UNC path should be of the form \\\\server\\share.
See original GitHub issueHi , I just simply use the default Razor Renderer send email function, following are my snippet code. But I get an exception error “The UNC path should be of the form \\server\share…”
Any idea? Please help, thanks.
` Email.DefaultRenderer = new RazorRenderer();
var template = "Dear @Model.Name, You are totally @Model.Compliment.";
var email = Email
.From("myemail@gmail.com")
.To("destination@gmail.com")
.Subject("woo nuget")
.UsingTemplate(template, new { Name = "Luke", Compliment = "Awesome" });
await email.SendAsync();`
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
`The UNC path should be of the form \\server\share` when ...
The UNC path should be of the form \\server\share when importing directly from UNC shared folder #4943.
Read more >Get a list of all UNC shared folders on a local network server
Unhandled Exception: System.ArgumentException: The UNC path should be of the form \server\share. Is there a way to get a list all shared ...
Read more >The UNC path should be of the form \\server\share.
The UNC path should be of the form \\server\share. Description: An unhandled exception occurred during the execution of the current web request.
Read more >The UNC path should be of the form \\server\share. : DTRC-6056
Message = “The UNC path should be of the form \\server\share.” ExceptionPath = Root.InnerException ClassName = System.ArgumentException
Read more >Support of the \\?\UNC\server\share syntax in Windows
1 Answer 1 ... The \\?\UNC\server\share\path\file syntax is only valid for single file commands such as CreateFile, GetFileAttributesEx, ... and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello, I was able to solve the problem by following these steps: First I will paste the original code and comment on it the modifications I made.
Original code: On Git [My changes] Add the sender before creating an instance of the “Email” class As you can see the error was only in the order in which the values were placed.
1º) // Using Razor templating package Email.DefaultRenderer = new RazorRenderer();
2º) // Using Smtp Sender package Email.DefaultSender = new SmtpSender(new smtpClient { host = “”, …});
3º) var template = “Dear @Model.Name, You are totally @Model.Compliment.”;
(Note the variable created below) var _email = Email .From(“bob@hotmail.com”) .To(“somedude@gmail.com”) .Subject(“woo nuget”) .UsingTemplate(template, new { Name = “Luke”, Compliment = “Awesome” });
//send normally _email.Send();
With these fixes, it works without errors
Hi all,
I am closing this issue. I think the solution is explained above - ensure the sender has been setup correctly before calling Email.From…