- ABP Framework version: v4.2.2
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes
- Exception message and stack trace:NA
- Steps to reproduce the issue:"NA
I have to configure gmail smtp. It is not working as per my current setup. Please find below the smtp details.
"Abp.Mailing.Smtp.Host": "smtp.gmail.com",
"Abp.Mailing.Smtp.Port": "587",
"Abp.Mailing.Smtp.UserName": "aztutedev11@gmail.com",
"Abp.Mailing.Smtp.Password": "$^&%^(*&FGJHGKJ", //Hased password
"Abp.Mailing.Smtp.Domain": "",
"Abp.Mailing.Smtp.EnableSsl": "true",
"Abp.Mailing.Smtp.UseDefaultCredentials": "false",
"Abp.Mailing.DefaultFromAddress": "aztutedev11@gmail.com",
"Abp.Mailing.DefaultFromDisplayName": "Aztute Command Center",
25 Answer(s)
-
0
You can use this to test the configure of email.
https://github.com/abpframework/abp-samples/tree/master/EmailSendDemo
-
0
Hello maliming, Thanks for help. current solution is working fine but our app is not sending the confirmation email while creating new user. Consider following steps:
1- Email confirmation enabled
2- SMTP configured in Host Json 3- NOTE: We have overridden the User creation App service like below sample
public class MyIdentityUserAppService : IdentityUserAppService { public override async Task<IdentityUserDto> CreateAsync(IdentityUserCreateDto input) { IdentityUserDto identityUserDto = await base.CreateAsync(input); return identityUserDto; } }
-
0
Can you try to remove this?
#if DEBUG context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>()); #endif
-
0
Where exactly i have to replace
-
0
You just need to remove the
NullEmailSender
. Global searchNullEmailSender
in your solution. -
0
still not working i.e. not receiving email.
-
0
Check your app logs.
-
0
Host Logs have no Error [ERR] record
-
0
During debug got following error message: {"The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters."}
-
0
Getting above error from:
await EmailSender.SendAsync( user.Email, "EmailConfirmation", emailContent,true );
-
0
-
0
hi Maliming, Thanks for help. Now i am receiving email but i have to do few more changes in my CreateUser Method:
public override async Task<IdentityUserDto> CreateAsync(IdentityUserCreateDto input) { IdentityUserDto identityUserDto = await base.CreateAsync(input);
var user = await _identityUserRepository.FindByNormalizedEmailAsync(input.Email.ToUpperInvariant()); var confirmationToken = await UserManager.GenerateEmailConfirmationTokenAsync(user); await _AccountEmailer.SendEmailConfirmationLinkAsync(user, confirmationToken, "MVC", "https://localhost:4200"); return identityUserDto; }
Now i have 2 challenges:
1- i am not getting full url but getting like this which is missing the domain: /Account/EmailConfirmation?userId=e3eecf67-85fc-59eb-face-3a00cf032a62&tenantId=&confirmationToken=CfDJ8M3speqUcVZAto9TzzaT5%2BngwUFUIw%2Fta3OQuB7gt8dBiWPePpBsnP6Sh9i72U7wAUau1Ogb8dHEBXcXsWQkc4QjzR4hQvMno7XFiWAAk3SzGD5I6nWNrOMluoal4YD%2FwMdgvYEtxjlaDvgq%2FLaMA1%2BHVjIzxSJ0O7LjXJH%2F9mCeUvnNnSkeiIkKlUR9Qg6VbLfyofwBgYTCkQEavdFrK07dZMDu84oI%2BVE6Y0GURzJI6KhoJOORn5IbOxYnBByKAw%3D%3D&returnUrl=https://localhost:4200
2- on calling this url with identity server url getting following error:
-
0
Do you have similar code like below?
Configure<AppUrlOptions>(options => { options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; // "SelfUrl": "https://localhost:44303" });
-
0
yes as part of "IdentityServerModule" --> ConfigureServices() method
-
0
Please also configure it in the project that calls
SendEmailConfirmationLinkAsync
. -
0
-
0
In Browser console i could see following error: Status 403 Forbidden VersionHTTP/2 Transferred8.81 KB (8.33 KB size)
we are surely not supporting HTTP/2. I am not sure how HTTP/2 protocol getting used
-
0
hi
https://support.abp.io/QA/Questions/1400/Email-Confirmation-Token-is-always-Invalid#answer-95c7bf9b-4915-0e3b-296e-39fcbdb8672d
-
0
could not understand which step to follow. Anyway i followed step to "It works for me after SetApplicationName" but still i am getting same issue
-
0
Thanks maliming. Issue solved. Problem lies here:
if (!hostingEnvironment.IsDevelopment()) { ConnectionMultiplexer redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); context.Services .AddDataProtection() .PersistKeysToStackExchangeRedis(redis, "EzpandCC-Protection-Keys") .SetApplicationName("MVC"); }
comment the If statement so that keys can be persited.
-
0
Good news.
-
0
Hello maliming, "Email Confirmation" link is working fine for host but not working for tenant. Getting below error:
https://localhost:44388/Account/EmailConfirmation?userId=faed4fdc-712f-f6b4-95c4-3a010e9dc1fe&tenantId=289f26e2-b3b5-3989-274c-39ff6bddef81&confirmationToken=CfDJ8Hq%2FLQp%2F%2FzRKgTVJkX09EFxA6tONfYjecuq%2FdyDt9%2FlkX1xQOjHA%2BZUrqbrBwdHhaWxKdwq%2BFfTVki5fJm2wPbJSytVZ2zQK9xBpm0a0rYaSsQZmbSgL8SzrrnVSHB7ivEBayxAHiBcOhWzVsAb68vBRm%2BumxUtIGHqTT7twScRt9XBzMVbppfXRlroblrIgVgDHfmUQSnsC%2Fo6d9T0dqXLRO%2BMr%2BMZeqsUEan%2FWA0Xy9vTxXnZOLxahR4Jy0up4TQ%3D%3D&returnUrl=http://localhost:4200
ApplicationException: Current tenant is different than given tenant. CurrentTenant.Id: , given tenantId: 289f26e2-b3b5-3989-274c-39ff6bddef81
-
0
-
0
-
0
hi shobhit
You can make the method do nothing