Hi,
I want to use NullEmailSender only debug configuration. But If I don't remove NullEmailSender service like below code on other environments, I can see only log file and I can not send email from pretest environment. Is this about ABP Framework? I think it doesn't need to remove NullEmailSender service when I used if DEBUG?
** context.Services.Remove(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>()); **
Thanks
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
If you're creating a bug/problem report, please include followings:
ABP Framework version: v5.3.3
UI type: MVC
DB provider: EF Core
Tiered (MVC): yes
Exception message and stack trace:
Steps to reproduce the issue:"
3 Answer(s)
-
0
hi
You can use
SmtpEmailSender
like:context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, SmtpEmailSender>());
-
0
hi
You can use
SmtpEmailSender
like:context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, SmtpEmailSender>());
But why we need to replace again, because I used NullEmailSender only if DEBUG tag.
-
0
I think you don't need to
Remove
in other environments.