- ABP Framework version: v8.2.0
- UI Type: Angular
- Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
- Exception message and full stack trace:
- Steps to reproduce the issue: Hi,
I can send e-mails using Mailkit via host API and application.
But here is the problem, the I forgot my password function from the separated authserver interface gives the following error.
Even though I installed Mailkit and related packages in the AuthServer project, the Account module still uses SmtpClient instead of Malkit.
The following code snippet has been added to the ...AuthServerModule.cs file. The application is a multitenant app and uses a sub-domain.
However, the ABP Account module or ABP Background job executer ignores to use Mailkit
7 Answer(s)
- 
    0hi Can you try to add the code below to all your backend projects? public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.Replace(ServiceDescriptor.Transient<IEmailSender, MailKitSmtpEmailSender>()); }
- 
    0Great. That works. But another issue came out. We are using the subdomain approach for tenants like https://{0}.authserver.domain.local:44319/Account/ResetPassword Since the reset link has been sent without "subdomain1" as https://authserver.domain.local:44319/Account/ResetPassword from authserver even though I made request via https://subdomain1.authserver.domain.local:44319/Account/ForgotPassword The reset link must include subdomain1 as follows. https://{subdomain1}.authserver.domain.local:44319/Account/ForgotPassword However, every email is being sent via a host link. 
- 
    0hi What is the value of your options.Applications["MVC"].RootUrl, This is the key url.
- 
    0options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; "SelfUrl": "https://authserver.domain.local:44319", 
- 
    0hi Try "SelfUrl": "https://{0}.authserver.domain.local:44319",or"SelfUrl": "https://{{tenantName}}.authserver.domain.local:44319",
- 
    0Thanks. Great, That worked. Let me try it on Azure. If there is no issue I will close the ticket 
- 
    0: ) 



 
                                