FluentEmail | Supports popular senders | Email library
kandi X-RAY | FluentEmail Summary
kandi X-RAY | FluentEmail Summary
The easiest way to send email from .NET and .NET Core. Use Razor for email templates and send using SendGrid, MailGun, SMTP and more. Maintained by Luke Lowrey - follow me on twitter @lukencode for updates. See my blog for a detailed guide A complete guide to send email in .NET.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of FluentEmail
FluentEmail Key Features
FluentEmail Examples and Code Snippets
Community Discussions
Trending Discussions on FluentEmail
QUESTION
I watched Tim Corey's video about FluentEmail. I tested his code and everything worked fine, but when I tried to implement it in Asp.Net Core I couldn't send any message using template. The only thing I could do was send a message using body.
I've seen some people also had the same problem, but I didn't find any solution.
ANSWER
Answered 2021-Sep-22 at 17:30I found the issue. I just had to add a reference to:
QUESTION
I'm using FluentEmail to send emails, everything is working well except there's this issue where the 'To' recipients keep getting added for every subsequent email.
For eg: If it's sending emails to someone@abc.com
:
The first time the
SendEmailAsync
method is called, it sends email to:someone@abc.com
The second time the
SendEmailAsync
method is called, it sends email to:someone@abc.com;someone@abc.com
The third time the
SendEmailAsync
method is called, it sends email to:someone@abc.com;someone@abc.com;someone@abc.com
and so on. It gets really long after some time.
My code looks like this:
ConfigureServices
method:
ANSWER
Answered 2021-Sep-03 at 21:49Using IFluentEmailFactory
instead of IFluentEmail
solved the issue for me.
Now the email service looks like this:
QUESTION
I'm trying to unit test FluentEmail, but I keep getting null
in the send response.
This is how it's set up in the ConfigureServices
method:
ANSWER
Answered 2021-Aug-19 at 14:15It is probably because of last function call SendAsync
is not mocked and therefore returning null by default.
Since it is async call, it makes sense to use ReturnsAsync
instead of Returns
.
ReturnsAsync
should also return an actual SendResponse
:
QUESTION
I have an ASP.Net MVC application (targeted for .Net Framework 4.7.2).
I installed FluentEmail.Core, FluentEmail.Smtp and FluentEmail.Razor (all of them version 3.0.0)
FluentEmail.Razor required LightRazor version 2.0.0-rc3, I had to manually install it since nuget default settings will only download final release (at the time of posting this question, the final stable release of RazorLight is version 1.0.0 which does not meet the requirement of FluentEmail.Razor v 3.0.0).
In my code, I am sending emails with no issues like this:
...ANSWER
Answered 2021-Aug-12 at 11:48I was able to reproduce the issue with a simple ASP.Net MVC application.
The code fails because Assembly.GetEntryAssembly()
returns null
here when it tries to build the RazorLightEngine
. The official documentation says Assembly.GetEntryAssembly()
:
Can return null when called from unmanaged code.
In your case, the issue happens because your code is probably run from a non-managed process (IIS Express).
Someone suggested this workaround which consists of replacing Assembly.GetEntryAssembly()
with Assembly.GetCallingAssembly()
(which always returns a non null value) :
QUESTION
I'm creating a .NET 5 worker service
app that watches few other apps and sends email when required.
I'm using FluentEmail to send those emails and everything works fine, until I deploy the app.
When I deploy the app and it attempts to send an email, it throws this exception:
...ANSWER
Answered 2021-Aug-02 at 13:58I had the exact same issue, but only within my published application. While debugging the worker service i didn't get the error message.
What fixed it for me was removing the p:PublishTrimmed=true
property from the dotnet publish
command.
For the sake of completeness, that's how my .csproj file looks like:
QUESTION
I have created my first WPF project and it is written in .NET framework 4.7.2
I have NO idea about the importance and functionality of this however I want to be able to install it in a few businesses with as little chance of them needing to install a new framework. Perhaps that isn't important and I should just include it in the installer, but that is what I am not sure of.
I tried rolling back to 4.5 .NET however now one of my packages will not install on that framework.
Install-Package : Could not install package 'FluentEmail.Mailgun 2.8.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
If I do any framework lower than 4.7.2 I can't see to run this, however I can't find documentation referring to this needing a specific framework to run.
Any pointers in the right direction would be helpful, eg. Is the framework important for a basic WPF app not using any crazy tech, just a few API's and mainly data storage? Can I force this package to install on an earlier based framework or is that going to fail?
...ANSWER
Answered 2020-Dec-08 at 12:43The FluentEmail.Mailgun package targets .NET Standard 2.0 which you can see by expanding the Dependencies section at NuGet.org.
.NET Standard 2.0 is implemented by .NET Framework 4.6.1 and later which you read from the compatibility matrix in the docs.
This basically means that you need to target at least 4.6.1 to be able to consume the package in your app.
There is a caveat though:
While NuGet considers .NET Framework 4.6.1 as supporting .NET Standard 1.5 through 2.0, there are several issues with consuming .NET Standard libraries that were built for those versions from .NET Framework 4.6.1 projects. For .NET Framework projects that need to use such libraries, we recommend that you upgrade the project to target .NET Framework 4.7.2 or higher.
So if you are developing a new app, you are recommended to either target .NET Framework 4.7.2 or later or even better .NET Core 3.1 or .NET 5.
If you want the full story of which versions that are officially supported on which operating systems, you should refer to the lifecycle FAQ in the docs.
Targeting 4.5 doesn't make much sense since the support for it ended back in January 2016.
QUESTION
I have an Azure Function that doesn't run in Azure. Locally it runs, but in Azure it doesn't. I have a try/catch in place, which doesn't catch any exception, but in the logs I get "2020-07-26T12:23:00.021 [Error] An exception occured." Don't understand what I'm doing wrong.
...ANSWER
Answered 2020-Jul-27 at 08:43Kritner's answer helped because it permited me to see the exception.
It was because it didn't find the file from which I read the values. I fixed that by constructing the path like this: var path = Path.Combine(context.FunctionAppDirectory, "1.csv");
Where context is ExecutionContex from Microsoft.Azure.WebJobs namespace.
It's fixed now.
Thanks!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install FluentEmail
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page